{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 什么是基础用户？\n",
    "# 比如整个时间探测器测量了一周的数据，我们将时间进行切片，3，2，2，其中3作为基础数据，\n",
    "# 将3时间长度的数据，作为基础数据，然后用2，2出现的用户，和3的用户进行相与，相与的用户，才是基础用户。\n",
    "# 其他的用户都是要判断新入网，新离网的。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "思路：\n",
    "- 这里假设数据有9天，先假设三天的数据为基础数据。然后用后面3天的数据去检测前三天的数据\n",
    "- 然后用后面3天的数据检测前6天的数据，重新给前面的标签进行标记。\n",
    "- 后面3天的数据，除去一些基础用户，其他都是属于新入网用户。\n",
    "- 然后前面9天的数据，又由后面的检测数据进行标记"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 导入模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import os\n",
    "from os import path\n",
    "\n",
    "import warnings\n",
    "\n",
    "warnings.filterwarnings('ignore')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [],
   "source": [
    "from datetime import date\n",
    "from datetime import time"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 定义函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_data(file_name):\n",
    "    '''\n",
    "    传入的是文件路径\n",
    "    读取并对数据进行处理\n",
    "    '''\n",
    "    file_extension = path.splitext(file_name)[1]\n",
    "    if file_extension == '.csv':\n",
    "        data = pd.read_csv(file_name, encoding='gbk')\n",
    "    elif file_extension == '.xlsx':\n",
    "        data = pd.read_excel(file_name)\n",
    "    drop_col = ['imei_', 'area_', 'msisdn_']\n",
    "    data.drop(drop_col, axis=1, inplace=True)\n",
    "    col = data.columns\n",
    "    for each in col:\n",
    "        if data[each].dtype == object:\n",
    "            data[each] = data[each].str.replace('\\t', '')\n",
    "    print('data processed successfully')\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 310,
   "metadata": {},
   "outputs": [],
   "source": [
    "def trans_to_time(data):\n",
    "    data.index = pd.to_datetime(data.update_time_)\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 319,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_status(data):\n",
    "    # 完整调试\n",
    "    year = data.index.year.min()\n",
    "    month = data.index.month.min()\n",
    "    day = data.index.day.min() # 本来不加min返回的是所有年份\n",
    "    time1 = datetime.datetime(year, month, day)\n",
    "\n",
    "    time_window = datetime.timedelta(days=window) # 这样可以直接和时间数据相加\n",
    "\n",
    "    time2 = (time1 + time_window)\n",
    "    # 将时间类型数据转换成字符串\n",
    "    stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "\n",
    "    # data.imsi_.loc[stime1:stime2]\n",
    "    d = {}\n",
    "    base_user = set(data.imsi_.loc[stime1:stime2])\n",
    "    while time1.day + window <= data.index.day.max():\n",
    "        time1, time2 = time2, time2 + time_window\n",
    "        stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "        user = set(data.imsi_.loc[stime1:stime2]) # 新用户\n",
    "        new_leaver = base_user - user # 注意集合运算的顺序 1 新离网\n",
    "        permanent = base_user & user # 2 常驻用户\n",
    "        new_commer = user - base_user # 0 新入网\n",
    "        base_user.update(user)\n",
    "        d.update(dict(zip(new_leaver, len(new_leaver)*[1])))\n",
    "        d.update(dict(zip(new_commer, len(new_commer)*[0])))\n",
    "        d.update(dict(zip(permanent, len(permanent)*[2])))\n",
    "    data['status'] = data.imsi_.map(d)\n",
    "    return data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 320,
   "metadata": {},
   "outputs": [],
   "source": [
    "def main():\n",
    "    os.listdir('../Project Data/')\n",
    "    os.chdir('../Project Data/')\n",
    "    data = get_data('20190524-001.csv')\n",
    "    data = trans_to_time(data)\n",
    "    data = get_status(data)\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 代码运行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 321,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "data processed successfully\n",
      "                               imsi_         update_time_  lac_  cellid_  \\\n",
      "update_time_                                                               \n",
      "2019-05-08 20:09:29  460110413044304  2019-05-08 20:09:29     0        0   \n",
      "2019-05-08 20:09:41  460110413042577  2019-05-08 20:09:41     0        0   \n",
      "2019-05-08 20:10:14  460110425023300  2019-05-08 20:10:14     0        0   \n",
      "2019-05-08 20:10:40  460110714141865  2019-05-08 20:10:40     0        0   \n",
      "2019-05-08 20:08:55  460016692088409  2019-05-08 20:08:55     0        0   \n",
      "\n",
      "                    status_ ap_type_  device_id_    eventid_  status  \n",
      "update_time_                                                          \n",
      "2019-05-08 20:09:29      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       2  \n",
      "2019-05-08 20:09:41      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       1  \n",
      "2019-05-08 20:10:14      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       1  \n",
      "2019-05-08 20:10:40      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       2  \n",
      "2019-05-08 20:08:55      拒绝  FDD-LTE  LT-SZSC001  Normal Lau       2  \n"
     ]
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 代码调试"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['4月',\n",
       " '20190529',\n",
       " '20190529-4G电围.xls',\n",
       " '.DS_Store',\n",
       " '分析数据',\n",
       " '3月',\n",
       " 'data_eda.ipynb',\n",
       " 'same',\n",
       " '20190529-001.csv',\n",
       " '20190424-001.xlsx',\n",
       " '20190524-001.csv',\n",
       " '20190529-4G_resave.csv',\n",
       " 'test.py',\n",
       " '20190422-灵瞳感知器.xls',\n",
       " '最新数据',\n",
       " '050823数据表']"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.listdir('../Project Data/')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "os.chdir('../Project Data/')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 160,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "data processed successfully\n"
     ]
    }
   ],
   "source": [
    "data = get_data('20190524-001.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>imsi_</th>\n",
       "      <th>update_time_</th>\n",
       "      <th>lac_</th>\n",
       "      <th>cellid_</th>\n",
       "      <th>status_</th>\n",
       "      <th>ap_type_</th>\n",
       "      <th>device_id_</th>\n",
       "      <th>eventid_</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>460110413044304</td>\n",
       "      <td>2019-05-08 20:09:29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>460110413042577</td>\n",
       "      <td>2019-05-08 20:09:41</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>460110425023300</td>\n",
       "      <td>2019-05-08 20:10:14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>460110714141865</td>\n",
       "      <td>2019-05-08 20:10:40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>460016692088409</td>\n",
       "      <td>2019-05-08 20:08:55</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "             imsi_         update_time_  lac_  cellid_ status_ ap_type_  \\\n",
       "0  460110413044304  2019-05-08 20:09:29     0        0      拒绝  FDD-LTE   \n",
       "1  460110413042577  2019-05-08 20:09:41     0        0      拒绝  FDD-LTE   \n",
       "2  460110425023300  2019-05-08 20:10:14     0        0      拒绝  FDD-LTE   \n",
       "3  460110714141865  2019-05-08 20:10:40     0        0      拒绝  FDD-LTE   \n",
       "4  460016692088409  2019-05-08 20:08:55     0        0      拒绝  FDD-LTE   \n",
       "\n",
       "   device_id_    eventid_  \n",
       "0  DX-SZSC001  Normal Lau  \n",
       "1  DX-SZSC001  Normal Lau  \n",
       "2  DX-SZSC001  Normal Lau  \n",
       "3  DX-SZSC001  Normal Lau  \n",
       "4  LT-SZSC001  Normal Lau  "
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 161,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.index = pd.to_datetime(data.update_time_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timedelta('16 days 02:30:09')"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.index.max() - data.index.min() # 时间周期是16天"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 应该随机选取天数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[4, 3]\n",
      "[3, 2]\n",
      "[2, 6]\n"
     ]
    }
   ],
   "source": [
    "for each in range(3): # 想要生成随机不重复的，还得使用kfold。这样会把所有天数都遍历一遍\n",
    "    print(random.sample([1,2,3,4,5,6],2))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "t = set(range(5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "set()"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[4, 0]"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "random.sample(t,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[3, 0]\n",
      "[1, 2]\n",
      "[4]\n"
     ]
    }
   ],
   "source": [
    "# 可以用这样的方式实现类似kfold的函数\n",
    "# 如果不是整数，则会报错\n",
    "\n",
    "for i in range(3):\n",
    "    try:\n",
    "        temp = random.sample(t, 2)\n",
    "    except ValueError:\n",
    "        temp = random.sample(t, len(t))\n",
    "    t -= set(temp)\n",
    "    print(temp)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 我们以天为单位，随机选取两天作为基础数据\n",
    "\n",
    "te = set(data.index.day)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "te"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "te"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 测试集合的一些方法\n",
    "\n",
    "s = set()\n",
    "s.add(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1}"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [],
   "source": [
    "l = set([1,2])\n",
    "s.update(l) # 使用update像集合里面添加元素"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1, 2}"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>imsi_</th>\n",
       "      <th>update_time_</th>\n",
       "      <th>lac_</th>\n",
       "      <th>cellid_</th>\n",
       "      <th>status_</th>\n",
       "      <th>ap_type_</th>\n",
       "      <th>device_id_</th>\n",
       "      <th>eventid_</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>update_time_</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:29</th>\n",
       "      <td>460110413044304</td>\n",
       "      <td>2019-05-08 20:09:29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:41</th>\n",
       "      <td>460110413042577</td>\n",
       "      <td>2019-05-08 20:09:41</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:14</th>\n",
       "      <td>460110425023300</td>\n",
       "      <td>2019-05-08 20:10:14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:40</th>\n",
       "      <td>460110714141865</td>\n",
       "      <td>2019-05-08 20:10:40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:08:55</th>\n",
       "      <td>460016692088409</td>\n",
       "      <td>2019-05-08 20:08:55</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                               imsi_         update_time_  lac_  cellid_  \\\n",
       "update_time_                                                               \n",
       "2019-05-08 20:09:29  460110413044304  2019-05-08 20:09:29     0        0   \n",
       "2019-05-08 20:09:41  460110413042577  2019-05-08 20:09:41     0        0   \n",
       "2019-05-08 20:10:14  460110425023300  2019-05-08 20:10:14     0        0   \n",
       "2019-05-08 20:10:40  460110714141865  2019-05-08 20:10:40     0        0   \n",
       "2019-05-08 20:08:55  460016692088409  2019-05-08 20:08:55     0        0   \n",
       "\n",
       "                    status_ ap_type_  device_id_    eventid_  \n",
       "update_time_                                                  \n",
       "2019-05-08 20:09:29      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:09:41      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:10:14      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:10:40      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:08:55      拒绝  FDD-LTE  LT-SZSC001  Normal Lau  "
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 开始尝试探索新入网，新离网用户\n",
    "\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "window = (data.index.max().day - data.index.min().day) // 5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "window # 设置时间窗口"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2019-05-08 00:00:00'"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.datetime(2019,5,8)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>imsi_</th>\n",
       "      <th>update_time_</th>\n",
       "      <th>lac_</th>\n",
       "      <th>cellid_</th>\n",
       "      <th>status_</th>\n",
       "      <th>ap_type_</th>\n",
       "      <th>device_id_</th>\n",
       "      <th>eventid_</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>update_time_</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:29</th>\n",
       "      <td>460110413044304</td>\n",
       "      <td>2019-05-08 20:09:29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:41</th>\n",
       "      <td>460110413042577</td>\n",
       "      <td>2019-05-08 20:09:41</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:14</th>\n",
       "      <td>460110425023300</td>\n",
       "      <td>2019-05-08 20:10:14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:40</th>\n",
       "      <td>460110714141865</td>\n",
       "      <td>2019-05-08 20:10:40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:08:55</th>\n",
       "      <td>460016692088409</td>\n",
       "      <td>2019-05-08 20:08:55</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-10 23:59:04</th>\n",
       "      <td>460013010514502</td>\n",
       "      <td>2019-05-10 23:59:04</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-10 23:59:06</th>\n",
       "      <td>460016607527914</td>\n",
       "      <td>2019-05-10 23:59:06</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-10 23:59:08</th>\n",
       "      <td>460015442027265</td>\n",
       "      <td>2019-05-10 23:59:08</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-10 23:59:13</th>\n",
       "      <td>460110410817264</td>\n",
       "      <td>2019-05-10 23:59:13</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-10 23:59:25</th>\n",
       "      <td>460016756520273</td>\n",
       "      <td>2019-05-10 23:59:25</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>38470 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                               imsi_         update_time_  lac_  cellid_  \\\n",
       "update_time_                                                               \n",
       "2019-05-08 20:09:29  460110413044304  2019-05-08 20:09:29     0        0   \n",
       "2019-05-08 20:09:41  460110413042577  2019-05-08 20:09:41     0        0   \n",
       "2019-05-08 20:10:14  460110425023300  2019-05-08 20:10:14     0        0   \n",
       "2019-05-08 20:10:40  460110714141865  2019-05-08 20:10:40     0        0   \n",
       "2019-05-08 20:08:55  460016692088409  2019-05-08 20:08:55     0        0   \n",
       "...                              ...                  ...   ...      ...   \n",
       "2019-05-10 23:59:04  460013010514502  2019-05-10 23:59:04     0        0   \n",
       "2019-05-10 23:59:06  460016607527914  2019-05-10 23:59:06     0        0   \n",
       "2019-05-10 23:59:08  460015442027265  2019-05-10 23:59:08     0        0   \n",
       "2019-05-10 23:59:13  460110410817264  2019-05-10 23:59:13     0        0   \n",
       "2019-05-10 23:59:25  460016756520273  2019-05-10 23:59:25     0        0   \n",
       "\n",
       "                    status_ ap_type_  device_id_    eventid_  \n",
       "update_time_                                                  \n",
       "2019-05-08 20:09:29      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:09:41      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:10:14      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:10:40      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:08:55      拒绝  FDD-LTE  LT-SZSC001  Normal Lau  \n",
       "...                     ...      ...         ...         ...  \n",
       "2019-05-10 23:59:04      拒绝  FDD-LTE  LT-SZSC001  Normal Lau  \n",
       "2019-05-10 23:59:06      拒绝  FDD-LTE  LT-SZSC001  Normal Lau  \n",
       "2019-05-10 23:59:08      拒绝  FDD-LTE  LT-SZSC001  Normal Lau  \n",
       "2019-05-10 23:59:13      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-10 23:59:25      拒绝  FDD-LTE  LT-SZSC001  Normal Lau  \n",
       "\n",
       "[38470 rows x 8 columns]"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.loc['20190508':'20190510']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "hour must be in 0..23",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-76-9a3b91a63b80>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mdate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m2020\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mtime\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m27\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m: hour must be in 0..23"
     ]
    }
   ],
   "source": [
    "date(2020,5,4) + time(27)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [],
   "source": [
    "import datetime"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2019"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "year.min()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.datetime(2020, 3, 3, 0, 0)"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.datetime(2020,2,23) + datetime.timedelta(days=9) # 这样可以实现时间相加，且不用担心月份会溢出的问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2020, 9, 16)"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.today() + datetime.timedelta(days=3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "update_time_\n",
       "2019-05-08 20:09:29    460110413044304\n",
       "2019-05-08 20:09:41    460110413042577\n",
       "2019-05-08 20:10:14    460110425023300\n",
       "2019-05-08 20:10:40    460110714141865\n",
       "2019-05-08 20:08:55    460016692088409\n",
       "                            ...       \n",
       "2019-05-10 23:59:04    460013010514502\n",
       "2019-05-10 23:59:06    460016607527914\n",
       "2019-05-10 23:59:08    460015442027265\n",
       "2019-05-10 23:59:13    460110410817264\n",
       "2019-05-10 23:59:25    460016756520273\n",
       "Name: imsi_, Length: 38470, dtype: int64"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 初步调试\n",
    "year = data.index.year.min()\n",
    "month = data.index.month.min()\n",
    "day = data.index.day.min() # 本来不加min返回的是所有年份\n",
    "time1 = datetime.datetime(year, month, day)\n",
    "\n",
    "time_window = datetime.timedelta(days=window)\n",
    "\n",
    "time2 = (time1 + time_window)\n",
    "# 将时间类型数据转换成字符串\n",
    "stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "\n",
    "data.imsi_.loc[stime1:stime2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [],
   "source": [
    "base_user = set(data.imsi_.loc[stime1:stime2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 这里假设0表示新入网，1表示新离网，2表示常出现用户\n",
    "d = dict(zip(set(data.imsi_), [0]*data.shape[0]))\n",
    "data['statues'] = data.imsi_.map(pd.Series(d))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>imsi_</th>\n",
       "      <th>update_time_</th>\n",
       "      <th>lac_</th>\n",
       "      <th>cellid_</th>\n",
       "      <th>status_</th>\n",
       "      <th>ap_type_</th>\n",
       "      <th>device_id_</th>\n",
       "      <th>eventid_</th>\n",
       "      <th>statues</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>update_time_</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:29</th>\n",
       "      <td>460110413044304</td>\n",
       "      <td>2019-05-08 20:09:29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:41</th>\n",
       "      <td>460110413042577</td>\n",
       "      <td>2019-05-08 20:09:41</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:14</th>\n",
       "      <td>460110425023300</td>\n",
       "      <td>2019-05-08 20:10:14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:40</th>\n",
       "      <td>460110714141865</td>\n",
       "      <td>2019-05-08 20:10:40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:08:55</th>\n",
       "      <td>460016692088409</td>\n",
       "      <td>2019-05-08 20:08:55</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                               imsi_         update_time_  lac_  cellid_  \\\n",
       "update_time_                                                               \n",
       "2019-05-08 20:09:29  460110413044304  2019-05-08 20:09:29     0        0   \n",
       "2019-05-08 20:09:41  460110413042577  2019-05-08 20:09:41     0        0   \n",
       "2019-05-08 20:10:14  460110425023300  2019-05-08 20:10:14     0        0   \n",
       "2019-05-08 20:10:40  460110714141865  2019-05-08 20:10:40     0        0   \n",
       "2019-05-08 20:08:55  460016692088409  2019-05-08 20:08:55     0        0   \n",
       "\n",
       "                    status_ ap_type_  device_id_    eventid_  statues  \n",
       "update_time_                                                           \n",
       "2019-05-08 20:09:29      拒绝  FDD-LTE  DX-SZSC001  Normal Lau        0  \n",
       "2019-05-08 20:09:41      拒绝  FDD-LTE  DX-SZSC001  Normal Lau        0  \n",
       "2019-05-08 20:10:14      拒绝  FDD-LTE  DX-SZSC001  Normal Lau        0  \n",
       "2019-05-08 20:10:40      拒绝  FDD-LTE  DX-SZSC001  Normal Lau        0  \n",
       "2019-05-08 20:08:55      拒绝  FDD-LTE  LT-SZSC001  Normal Lau        0  "
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [],
   "source": [
    "time1, time2 = time2, time1 + time_window\n",
    "stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "user = set(data.imsi_.loc[stime1:stime2])\n",
    "new_leaver = base_user - user # 注意集合运算的顺序 1 新离网\n",
    "permanent = base_user & user # 2 常驻用户\n",
    "new_commer = user - base_user # 0 新入网"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 开始更新用户状态\n",
    "base_user.update(user) # 先增加基础用户，所有出现的用户都要加入进去\n",
    "leaver_code = dict(zip(new_leaver, [1]*len(new_leaver)))\n",
    "permanent_code = dict(zip(permanent, [2]*len(permanent)))\n",
    "commer_code = dict(zip(new_commer, [0]*len(new_commer)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['statues'] = data.imsi_.map(leaver_code)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "update_time_\n",
       "2019-05-08 20:09:29    NaN\n",
       "2019-05-08 20:09:41    1.0\n",
       "2019-05-08 20:10:14    1.0\n",
       "2019-05-08 20:10:40    NaN\n",
       "2019-05-08 20:08:55    NaN\n",
       "                      ... \n",
       "2019-05-24 22:38:32    NaN\n",
       "2019-05-24 22:38:34    NaN\n",
       "2019-05-24 22:38:36    1.0\n",
       "2019-05-24 22:39:00    NaN\n",
       "2019-05-24 22:39:04    NaN\n",
       "Name: statues, Length: 338898, dtype: float64"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['statues'] # 发现不匹配的会被认定为空值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "解决办法，都组合成一个字典"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "dictionary update sequence element #0 has length 9248; 2 is required",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-138-37a33354b989>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0mcoder\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m{\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mcoder\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupdate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mleaver_code\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpermanent_code\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcommer_code\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mValueError\u001b[0m: dictionary update sequence element #0 has length 9248; 2 is required"
     ]
    }
   ],
   "source": [
    "coder = {}\n",
    "coder.update([leaver_code, permanent_code, commer_code])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 141,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{460069107007489: 1,\n",
       " 460017051631619: 1,\n",
       " 460110411595787: 1,\n",
       " 460012348604444: 1,\n",
       " 460078194425886: 1,\n",
       " 460016087629858: 1,\n",
       " 460007444250659: 1,\n",
       " 460090842120226: 1,\n",
       " 460015316107305: 1,\n",
       " 460016291610665: 1,\n",
       " 460023116398641: 1,\n",
       " 460071791657011: 1,\n",
       " 460110411399223: 1,\n",
       " 460007392673852: 1,\n",
       " 460071791657020: 1,\n",
       " 460110410776637: 1,\n",
       " 460002601893952: 1,\n",
       " 460021606711373: 1,\n",
       " 460022200664143: 1,\n",
       " 460009190391888: 1,\n",
       " 460013573505104: 1,\n",
       " 460006851838031: 1,\n",
       " 460016637509718: 1,\n",
       " 460045960904799: 1,\n",
       " 460018862915684: 1,\n",
       " 460000500318309: 1,\n",
       " 460012048613480: 1,\n",
       " 460078237253736: 1,\n",
       " 460110412841067: 1,\n",
       " 460000970178667: 1,\n",
       " 460017912316013: 1,\n",
       " 460018678202482: 1,\n",
       " 460016667623541: 1,\n",
       " 460015440035959: 1,\n",
       " 460110411858040: 1,\n",
       " 460018486607999: 1,\n",
       " 460016840016001: 1,\n",
       " 460002321563780: 1,\n",
       " 460010190504071: 1,\n",
       " 460002306850951: 1,\n",
       " 460010420502665: 1,\n",
       " 460093020012682: 1,\n",
       " 460012268617866: 1,\n",
       " 460110415069326: 1,\n",
       " 460017227628687: 1,\n",
       " 460110714175631: 1,\n",
       " 460110959214737: 1,\n",
       " 460000146620562: 1,\n",
       " 460000840155283: 1,\n",
       " 460002606907544: 1,\n",
       " 460110414774424: 1,\n",
       " 460028137275548: 1,\n",
       " 460002251669665: 1,\n",
       " 460110381285546: 1,\n",
       " 460000015155372: 1,\n",
       " 460012989939885: 1,\n",
       " 460010302111922: 1,\n",
       " 460018009505971: 1,\n",
       " 460024967102647: 1,\n",
       " 460077295141048: 1,\n",
       " 460097990000835: 1,\n",
       " 460009781952715: 1,\n",
       " 460016407511249: 1,\n",
       " 460014112571605: 1,\n",
       " 460110410809558: 1,\n",
       " 460110339375318: 1,\n",
       " 460079373320405: 1,\n",
       " 460006841876696: 1,\n",
       " 460013030113499: 1,\n",
       " 460015557509340: 1,\n",
       " 460003193290975: 1,\n",
       " 460016562307300: 1,\n",
       " 460011179704548: 1,\n",
       " 460075927109869: 1,\n",
       " 460018964005103: 1,\n",
       " 460018888605939: 1,\n",
       " 460000930332919: 1,\n",
       " 460011337220354: 1,\n",
       " 460007741686018: 1,\n",
       " 460020185792772: 1,\n",
       " 460003006710020: 1,\n",
       " 460002641838342: 1,\n",
       " 460061001023751: 1,\n",
       " 460029271179524: 1,\n",
       " 460013277708553: 1,\n",
       " 460011481104649: 1,\n",
       " 460018984026384: 1,\n",
       " 460060062089503: 1,\n",
       " 460015567601957: 1,\n",
       " 460011895619884: 1,\n",
       " 460027801829678: 1,\n",
       " 460029198369071: 1,\n",
       " 460060062089521: 1,\n",
       " 460060062089522: 1,\n",
       " 460060062089527: 1,\n",
       " 460002506768702: 1,\n",
       " 460018208506175: 1,\n",
       " 460110364803393: 1,\n",
       " 460029020766532: 1,\n",
       " 460016907059524: 1,\n",
       " 460110959378760: 1,\n",
       " 460060062089547: 1,\n",
       " 460014487634254: 1,\n",
       " 460110394130769: 1,\n",
       " 460015677505877: 1,\n",
       " 460099511779669: 1,\n",
       " 460019074203991: 1,\n",
       " 460060062089560: 1,\n",
       " 460015733965148: 1,\n",
       " 460077707559262: 1,\n",
       " 460028211593572: 1,\n",
       " 460010841604452: 1,\n",
       " 460018559123812: 1,\n",
       " 460029903634794: 1,\n",
       " 460110663778667: 1,\n",
       " 460060062089587: 1,\n",
       " 460095167103347: 1,\n",
       " 460000191742338: 1,\n",
       " 460015316107652: 1,\n",
       " 460110959542667: 1,\n",
       " 460018948604310: 1,\n",
       " 460110412087711: 1,\n",
       " 460061071016353: 1,\n",
       " 460019394019751: 1,\n",
       " 460012680511913: 1,\n",
       " 460017191616950: 1,\n",
       " 460017064935871: 1,\n",
       " 460002901328327: 1,\n",
       " 460002891366868: 1,\n",
       " 460015547515356: 1,\n",
       " 460011792105948: 1,\n",
       " 460002581348831: 1,\n",
       " 460014165623270: 1,\n",
       " 460110869266924: 1,\n",
       " 460014986658285: 1,\n",
       " 460002218246636: 1,\n",
       " 460010623402479: 1,\n",
       " 460002621882863: 1,\n",
       " 460015310504432: 1,\n",
       " 460110869627381: 1,\n",
       " 460009383854581: 1,\n",
       " 460002971156989: 1,\n",
       " 460110413431295: 1,\n",
       " 460029140763142: 1,\n",
       " 460018258510348: 1,\n",
       " 460028174729740: 1,\n",
       " 454006109110798: 1,\n",
       " 460010688610829: 1,\n",
       " 460069087052302: 1,\n",
       " 460000392610320: 1,\n",
       " 460002676146704: 1,\n",
       " 460110415790613: 1,\n",
       " 460016296526368: 1,\n",
       " 460018908103207: 1,\n",
       " 460015026602540: 1,\n",
       " 460015557607981: 1,\n",
       " 460017644241454: 1,\n",
       " 460023128851005: 1,\n",
       " 460110411235901: 1,\n",
       " 460110410744388: 1,\n",
       " 460019522503244: 1,\n",
       " 460019239912013: 1,\n",
       " 460012490687055: 1,\n",
       " 460001693794897: 1,\n",
       " 460016727622232: 1,\n",
       " 460004312285784: 1,\n",
       " 460099038806618: 1,\n",
       " 460003732161116: 1,\n",
       " 460020287996509: 1,\n",
       " 460012812304990: 1,\n",
       " 460017707942498: 1,\n",
       " 460020308574822: 1,\n",
       " 460026175324777: 1,\n",
       " 460028755378798: 1,\n",
       " 460012890096243: 1,\n",
       " 460113324245624: 1,\n",
       " 460110724268665: 1,\n",
       " 460110414119546: 1,\n",
       " 460012960318086: 1,\n",
       " 460014827602567: 1,\n",
       " 460110080180873: 1,\n",
       " 460000330154636: 1,\n",
       " 460002381824652: 1,\n",
       " 460018351047308: 1,\n",
       " 460110797865617: 1,\n",
       " 460017176248980: 1,\n",
       " 460078983578270: 1,\n",
       " 460015717679797: 1,\n",
       " 460015292318391: 1,\n",
       " 460069087052480: 1,\n",
       " 460002631877313: 1,\n",
       " 460000060113602: 1,\n",
       " 460110411006665: 1,\n",
       " 460001701987023: 1,\n",
       " 460003872113360: 1,\n",
       " 460000146621137: 1,\n",
       " 460000146522836: 1,\n",
       " 460015292318428: 1,\n",
       " 460004830577373: 1,\n",
       " 460078228931294: 1,\n",
       " 460110417527528: 1,\n",
       " 460023179182825: 1,\n",
       " 460016637510380: 1,\n",
       " 450050990047985: 1,\n",
       " 460015292318452: 1,\n",
       " 460018998608640: 1,\n",
       " 460110672429833: 1,\n",
       " 460016797614858: 1,\n",
       " 460113328046862: 1,\n",
       " 460075949032214: 1,\n",
       " 460000055034661: 1,\n",
       " 460015292318505: 1,\n",
       " 460110413005610: 1,\n",
       " 460029198369579: 1,\n",
       " 460021124367149: 1,\n",
       " 460015292318513: 1,\n",
       " 460018822972213: 1,\n",
       " 460095167103799: 1,\n",
       " 460078115455799: 1,\n",
       " 460000201737031: 1,\n",
       " 460017031643976: 1,\n",
       " 460002911388491: 1,\n",
       " 460003193291596: 1,\n",
       " 460110412809036: 1,\n",
       " 460000373179216: 1,\n",
       " 460110414971729: 1,\n",
       " 460013257753433: 1,\n",
       " 460015812346713: 1,\n",
       " 460018064032614: 1,\n",
       " 460093020013419: 1,\n",
       " 460110419329902: 1,\n",
       " 460000500351856: 1,\n",
       " 460028207727473: 1,\n",
       " 460092031009651: 1,\n",
       " 460004961878900: 1,\n",
       " 460110162494333: 1,\n",
       " 460078209860478: 1,\n",
       " 460007972275077: 1,\n",
       " 460069007033222: 1,\n",
       " 460016766518151: 1,\n",
       " 460093020013453: 1,\n",
       " 460003160425358: 1,\n",
       " 460015266104213: 1,\n",
       " 460000272548763: 1,\n",
       " 460017310991262: 1,\n",
       " 460000970310559: 1,\n",
       " 460002841363363: 1,\n",
       " 460110443905955: 1,\n",
       " 460029212525476: 1,\n",
       " 460018708612005: 1,\n",
       " 460110339310506: 1,\n",
       " 460071065125805: 1,\n",
       " 460008922219442: 1,\n",
       " 460010884039604: 1,\n",
       " 460003562193849: 1,\n",
       " 460012228608954: 1,\n",
       " 460093020013499: 1,\n",
       " 460110419395514: 1,\n",
       " 460028147139520: 1,\n",
       " 460007880360905: 1,\n",
       " 460019623625675: 1,\n",
       " 460017907729367: 1,\n",
       " 460002631746520: 1,\n",
       " 460110438761433: 1,\n",
       " 460010362110940: 1,\n",
       " 460061081043935: 1,\n",
       " 460012088624103: 1,\n",
       " 460016607527914: 1,\n",
       " 460069047010285: 1,\n",
       " 460078201635822: 1,\n",
       " 460023128032240: 1,\n",
       " 460006653297649: 1,\n",
       " 460025001280498: 1,\n",
       " 460010388620275: 1,\n",
       " 460110413005821: 1,\n",
       " 460017725768704: 1,\n",
       " 460015547515912: 1,\n",
       " 460093347103752: 1,\n",
       " 460004352164874: 1,\n",
       " 460010352116748: 1,\n",
       " 460028893299727: 1,\n",
       " 460016870786065: 1,\n",
       " 460110415266835: 1,\n",
       " 460110416610326: 1,\n",
       " 460017982080025: 1,\n",
       " 460110417626140: 1,\n",
       " 460016666608676: 1,\n",
       " 460061001057322: 1,\n",
       " 460046658503735: 1,\n",
       " 460017161602112: 1,\n",
       " 460023136453701: 1,\n",
       " 460014576600135: 1,\n",
       " 460002841330765: 1,\n",
       " 460013352059982: 1,\n",
       " 460021125448781: 1,\n",
       " 460007172146259: 1,\n",
       " 460021180957779: 1,\n",
       " 460093090006104: 1,\n",
       " 460110730429531: 1,\n",
       " 460003193291867: 1,\n",
       " 460090419807336: 1,\n",
       " 460110410908782: 1,\n",
       " 460090472006766: 1,\n",
       " 460110351598704: 1,\n",
       " 460023134618742: 1,\n",
       " 460093090006136: 1,\n",
       " 460012198626425: 1,\n",
       " 460014306690170: 1,\n",
       " 460090992100477: 1,\n",
       " 460028186723466: 1,\n",
       " 460093090006159: 1,\n",
       " 460018353112207: 1,\n",
       " 460002431829138: 1,\n",
       " 460000274580629: 1,\n",
       " 460004872127637: 1,\n",
       " 460017272620186: 1,\n",
       " 460015540339869: 1,\n",
       " 460005243290781: 1,\n",
       " 460015316665509: 1,\n",
       " 460000060146860: 1,\n",
       " 460010388620462: 1,\n",
       " 460015537521842: 1,\n",
       " 460008800224436: 1,\n",
       " 460010360112311: 1,\n",
       " 460016890774714: 1,\n",
       " 460019038520506: 1,\n",
       " 460025583535292: 1,\n",
       " 460002431829183: 1,\n",
       " 460002431829185: 1,\n",
       " 460015616525508: 1,\n",
       " 460020558660805: 1,\n",
       " 460019532924104: 1,\n",
       " 460110784824524: 1,\n",
       " 460029894657229: 1,\n",
       " 460093040002264: 1,\n",
       " 460015170094299: 1,\n",
       " 460012408636635: 1,\n",
       " 460013070615773: 1,\n",
       " 460007344669924: 1,\n",
       " 460017580442854: 1,\n",
       " 460018796987624: 1,\n",
       " 460093090006251: 1,\n",
       " 460024061068523: 1,\n",
       " 460021123253487: 1,\n",
       " 460018840044789: 1,\n",
       " 460011448632566: 1,\n",
       " 460110413202678: 1,\n",
       " 460016797517049: 1,\n",
       " 460015466218751: 1,\n",
       " 460018994087170: 1,\n",
       " 460025209029891: 1,\n",
       " 460025066849540: 1,\n",
       " 460000060114180: 1,\n",
       " 460020238255364: 1,\n",
       " 460110396196103: 1,\n",
       " 460000055035151: 1,\n",
       " 460011088643355: 1,\n",
       " 460003016279324: 1,\n",
       " 460018804000037: 1,\n",
       " 460061011051814: 1,\n",
       " 460078430258470: 1,\n",
       " 460029140763944: 1,\n",
       " 460011448632621: 1,\n",
       " 460020242711856: 1,\n",
       " 460015237727545: 1,\n",
       " 460096160105789: 1,\n",
       " 460110457013571: 1,\n",
       " 460015537521988: 1,\n",
       " 460014844970309: 1,\n",
       " 460017121625414: 1,\n",
       " 460022193489224: 1,\n",
       " 460010388620619: 1,\n",
       " 460110415267147: 1,\n",
       " 460011117806924: 1,\n",
       " 460002841298252: 1,\n",
       " 460006584288597: 1,\n",
       " 460013736920409: 1,\n",
       " 460016010102113: 1,\n",
       " 460069069063524: 1,\n",
       " 460015257781607: 1,\n",
       " 460014794212717: 1,\n",
       " 460012802344303: 1,\n",
       " 460003533227376: 1,\n",
       " 460023138026865: 1,\n",
       " 460028755215730: 1,\n",
       " 460110416151934: 1,\n",
       " 460028186527102: 1,\n",
       " 460001102595458: 1,\n",
       " 460020805862788: 1,\n",
       " 460015566259589: 1,\n",
       " 460002606876040: 1,\n",
       " 460020241991051: 1,\n",
       " 460012222612877: 1,\n",
       " 460020185793936: 1,\n",
       " 460069087053201: 1,\n",
       " 460077575210398: 1,\n",
       " 460110205486495: 1,\n",
       " 460010162521503: 1,\n",
       " 460069087053218: 1,\n",
       " 460015557510562: 1,\n",
       " 460017725703587: 1,\n",
       " 460002981152168: 1,\n",
       " 460029198140845: 1,\n",
       " 460110869104046: 1,\n",
       " 460110396622255: 1,\n",
       " 460013129663923: 1,\n",
       " 460015747728826: 1,\n",
       " 460045960906172: 1,\n",
       " 460000680379840: 1,\n",
       " 460092041004492: 1,\n",
       " 460010322691548: 1,\n",
       " 460029867492828: 1,\n",
       " 460002781365733: 1,\n",
       " 460002606941669: 1,\n",
       " 460012495341029: 1,\n",
       " 460110797866472: 1,\n",
       " 460016972301797: 1,\n",
       " 460093090006506: 1,\n",
       " 460003742189049: 1,\n",
       " 460020109215230: 1,\n",
       " 460018778113538: 1,\n",
       " 460006972130819: 1,\n",
       " 460110413497870: 1,\n",
       " 460016890775064: 1,\n",
       " 460019072501283: 1,\n",
       " 460016627516970: 1,\n",
       " 460075888936497: 1,\n",
       " 460016196519483: 1,\n",
       " 460110414054972: 1,\n",
       " 460006742885949: 1,\n",
       " 460000930367049: 1,\n",
       " 460017141614156: 1,\n",
       " 460002665137751: 1,\n",
       " 460095032723041: 1,\n",
       " 460015816509031: 1,\n",
       " 460095337105000: 1,\n",
       " 460069107009129: 1,\n",
       " 460012802344557: 1,\n",
       " 460110413366896: 1,\n",
       " 460093030008435: 1,\n",
       " 460006523733624: 1,\n",
       " 460012078630521: 1,\n",
       " 460110412514946: 1,\n",
       " 460110413170307: 1,\n",
       " 460003782755974: 1,\n",
       " 460010422306443: 1,\n",
       " 460018850072204: 1,\n",
       " 460020240385680: 1,\n",
       " 460015996602002: 1,\n",
       " 460001993950871: 1,\n",
       " 460017371612824: 1,\n",
       " 460008912225946: 1,\n",
       " 460011508631196: 1,\n",
       " 460010082305698: 1,\n",
       " 460010382624420: 1,\n",
       " 460110413858469: 1,\n",
       " 460016747611814: 1,\n",
       " 460110414710451: 1,\n",
       " 460020106561203: 1,\n",
       " 460018739611319: 1,\n",
       " 460075206215357: 1,\n",
       " 460029141190335: 1,\n",
       " 460002581677762: 1,\n",
       " 460093030008516: 1,\n",
       " 460093080012488: 1,\n",
       " 460016216606409: 1,\n",
       " 460045960906444: 1,\n",
       " 460110407501521: 1,\n",
       " 460002319894226: 1,\n",
       " 460003330459348: 1,\n",
       " 460017840391893: 1,\n",
       " 460019854214870: 1,\n",
       " 460069047076566: 1,\n",
       " 460110418773725: 1,\n",
       " 460093520709343: 1,\n",
       " 460012248631008: 1,\n",
       " 460012661311200: 1,\n",
       " 460013464028909: 1,\n",
       " 460079747827438: 1,\n",
       " 460069087053556: 1,\n",
       " 460002771896054: 1,\n",
       " 460027766343422: 1,\n",
       " 460020106266372: 1,\n",
       " 460010362111748: 1,\n",
       " 460011963025157: 1,\n",
       " 460078107756293: 1,\n",
       " 460001941915403: 1,\n",
       " 460000510314256: 1,\n",
       " 460023076030224: 1,\n",
       " 460016216508183: 1,\n",
       " 460004800562973: 1,\n",
       " 460111151073065: 1,\n",
       " 460020354516779: 1,\n",
       " 460012288608049: 1,\n",
       " 460016464201525: 1,\n",
       " 460093030008637: 1,\n",
       " 460069107009345: 1,\n",
       " 460002073249604: 1,\n",
       " 460110416250694: 1,\n",
       " 460016736503622: 1,\n",
       " 460075382605640: 1,\n",
       " 460011780605769: 1,\n",
       " 460000091277131: 1,\n",
       " 460069839013713: 1,\n",
       " 460016204613463: 1,\n",
       " 460018922948443: 1,\n",
       " 460110413104988: 1,\n",
       " 460078946420577: 1,\n",
       " 460113328047970: 1,\n",
       " 460015796520801: 1,\n",
       " 460029893412707: 1,\n",
       " 460110415988581: 1,\n",
       " 460000370919274: 1,\n",
       " 460092041004908: 1,\n",
       " 460069047076724: 1,\n",
       " 460010862511988: 1,\n",
       " 460016660612980: 1,\n",
       " 460021124335482: 1,\n",
       " 460003183232893: 1,\n",
       " 460014280607617: 1,\n",
       " 460113328048002: 1,\n",
       " 460029894756231: 1,\n",
       " 460023134488458: 1,\n",
       " 460019112314771: 1,\n",
       " 460078887110549: 1,\n",
       " 460110410909590: 1,\n",
       " 460028896184218: 1,\n",
       " 460110804879265: 1,\n",
       " 460110411007913: 1,\n",
       " 460110192019377: 1,\n",
       " 460016627517363: 1,\n",
       " 460000421382068: 1,\n",
       " 460110701987771: 1,\n",
       " 460017011689409: 1,\n",
       " 460110416971714: 1,\n",
       " 460110410975171: 1,\n",
       " 460110814971848: 1,\n",
       " 460014936623051: 1,\n",
       " 460020353796048: 1,\n",
       " 460004770547665: 1,\n",
       " 460002319730647: 1,\n",
       " 460069839013849: 1,\n",
       " 460007464273885: 1,\n",
       " 460016737519584: 1,\n",
       " 460028743485417: 1,\n",
       " 460110751860718: 1,\n",
       " 460002841397232: 1,\n",
       " 460077120817137: 1,\n",
       " 460001920387058: 1,\n",
       " 460013756942330: 1,\n",
       " 460006574295037: 1,\n",
       " 460000710330366: 1,\n",
       " 460010802546690: 1,\n",
       " 460093090007044: 1,\n",
       " 460002815412229: 1,\n",
       " 460093090007046: 1,\n",
       " 460010042689546: 1,\n",
       " 454065216161807: 1,\n",
       " 460022170028054: 1,\n",
       " 460004960569366: 1,\n",
       " 460002591868952: 1,\n",
       " 460016116107295: 1,\n",
       " 460060550006822: 1,\n",
       " 460002241677351: 1,\n",
       " 460012934236203: 1,\n",
       " 460019098519598: 1,\n",
       " 460018922948657: 1,\n",
       " 460015291500594: 1,\n",
       " 460016787621938: 1,\n",
       " 460015547615284: 1,\n",
       " 460002319796280: 1,\n",
       " 460020810451005: 1,\n",
       " 460045960906818: 1,\n",
       " 460075063183438: 1,\n",
       " 460110355269710: 1,\n",
       " 460012831508560: 1,\n",
       " 460110414710864: 1,\n",
       " 460019028527186: 1,\n",
       " 460018643601504: 1,\n",
       " 460013090637921: 1,\n",
       " 460002815314020: 1,\n",
       " 460016244000868: 1,\n",
       " 460016996026470: 1,\n",
       " 460013788104814: 1,\n",
       " 460010414606447: 1,\n",
       " 460002606680178: 1,\n",
       " 460016677521523: 1,\n",
       " 460015292319859: 1,\n",
       " 460066544027766: 1,\n",
       " 460010432104576: 1,\n",
       " 460019916966017: 1,\n",
       " 460078983678082: 1,\n",
       " 460013060524166: 1,\n",
       " 460093090007174: 1,\n",
       " 460110417528972: 1,\n",
       " 460027681933458: 1,\n",
       " 460014796966038: 1,\n",
       " 460012078631069: 1,\n",
       " 460015696611485: 1,\n",
       " 460002506803369: 1,\n",
       " 460016497526957: 1,\n",
       " 460015336655024: 1,\n",
       " 460000845039796: 1,\n",
       " 460078194133175: 1,\n",
       " 460002492352698: 1,\n",
       " 460012862310593: 1,\n",
       " 460110129400009: 1,\n",
       " 460071791691978: 1,\n",
       " 460060055079113: 1,\n",
       " 460016046901452: 1,\n",
       " 460011458627793: 1,\n",
       " 460110413138131: 1,\n",
       " 460016866003157: 1,\n",
       " 460013350258905: 1,\n",
       " 460010378627294: 1,\n",
       " 460010311518431: 1,\n",
       " 460069047077098: 1,\n",
       " 460012930369771: 1,\n",
       " 460069047077104: 1,\n",
       " 454075240024310: 1,\n",
       " 460028112079097: 1,\n",
       " 460016666511609: 1,\n",
       " 460002601634046: 1,\n",
       " 460110746913030: 1,\n",
       " 460110420150536: 1,\n",
       " 460110364346642: 1,\n",
       " 460017520609555: 1,\n",
       " 460015202339096: 1,\n",
       " 460078243973417: 1,\n",
       " 460095202101547: 1,\n",
       " 460015616526636: 1,\n",
       " 460003016116525: 1,\n",
       " 460021790902573: 1,\n",
       " 460002371897647: 1,\n",
       " 460015326660910: 1,\n",
       " 460110414711090: 1,\n",
       " 460023136291122: 1,\n",
       " 460025125079348: 1,\n",
       " 460015237499189: 1,\n",
       " 460066544027954: 1,\n",
       " 460010676914485: 1,\n",
       " 460023236790588: 1,\n",
       " 460012318624062: 1,\n",
       " 460000020138303: 1,\n",
       " 460017982081345: 1,\n",
       " 460001681377607: 1,\n",
       " 460110411696458: 1,\n",
       " 220018003872080: 1,\n",
       " 460093090007378: 1,\n",
       " 460016631613779: 1,\n",
       " 310260309035353: 1,\n",
       " 460004312287579: 1,\n",
       " 460013020514654: 1,\n",
       " 460110725712222: 1,\n",
       " 460006684854633: 1,\n",
       " 460003543255403: 1,\n",
       " 460113311041900: 1,\n",
       " 460110402062702: 1,\n",
       " 460093080013168: 1,\n",
       " 460002914797938: 1,\n",
       " 460013267716469: 1,\n",
       " 460002941176186: 1,\n",
       " 460093090007425: 1,\n",
       " 460013942016390: 1,\n",
       " 460008240384396: 1,\n",
       " 460000055069070: 1,\n",
       " 460016600091050: 1,\n",
       " 460016600091052: 1,\n",
       " 460096090704302: 1,\n",
       " 460000030132654: 1,\n",
       " 460000146557358: 1,\n",
       " 460006240389553: 1,\n",
       " 460069839014331: 1,\n",
       " 460000860768701: 1,\n",
       " 460018832968129: 1,\n",
       " 460110505773509: 1,\n",
       " 460028174862793: 1,\n",
       " 460013641959887: 1,\n",
       " 460016757508559: 1,\n",
       " 460016286501331: 1,\n",
       " 460000170346964: 1,\n",
       " 460012308629980: 1,\n",
       " 460095142103520: 1,\n",
       " 460042204908003: 1,\n",
       " 460023192783335: 1,\n",
       " 460017041639912: 1,\n",
       " 460065524025837: 1,\n",
       " 460004343253486: 1,\n",
       " 460000146491888: 1,\n",
       " 460021125188081: 1,\n",
       " 454001060219383: 1,\n",
       " 460012308630008: 1,\n",
       " 460093317122553: 1,\n",
       " 460019936922107: 1,\n",
       " 460018904009217: 1,\n",
       " 460065524025859: 1,\n",
       " 460065524025860: 1,\n",
       " 460110955710982: 1,\n",
       " 460001125042695: 1,\n",
       " 460012984240646: 1,\n",
       " 460015537523207: 1,\n",
       " 460000060148234: 1,\n",
       " 460019098913294: 1,\n",
       " 460007464274459: 1,\n",
       " 460004322249248: 1,\n",
       " 460018678204961: 1,\n",
       " 460020308576803: 1,\n",
       " 460004202121764: 1,\n",
       " 460020101024291: 1,\n",
       " 460028896217639: 1,\n",
       " 460016552315433: 1,\n",
       " 460028896184877: 1,\n",
       " 460015326104109: 1,\n",
       " 460110297827887: 1,\n",
       " 460110413957683: 1,\n",
       " 460110713981494: 1,\n",
       " 460022071265848: 1,\n",
       " 460010510617145: 1,\n",
       " 460013020514873: 1,\n",
       " 460010878405179: 1,\n",
       " 460017369352765: 1,\n",
       " 460004202121791: 1,\n",
       " 460011765303873: 1,\n",
       " 460110714047043: 1,\n",
       " 460110249921093: 1,\n",
       " 460004202121801: 1,\n",
       " 460093040003658: 1,\n",
       " 460010352609870: 1,\n",
       " 460015856618064: 1,\n",
       " 460110014515794: 1,\n",
       " 460002694400594: 1,\n",
       " 460110869662293: 1,\n",
       " 460078136855125: 1,\n",
       " 460065524025943: 1,\n",
       " 460065524025946: 1,\n",
       " 460002922138204: 1,\n",
       " 460007890356829: 1,\n",
       " 460065524025954: 1,\n",
       " 460006544280167: 1,\n",
       " 460065524025962: 1,\n",
       " 460011765303916: 1,\n",
       " 460010077522542: 1,\n",
       " 460075227744878: 1,\n",
       " 460093040003696: 1,\n",
       " 460020185959031: 1,\n",
       " 460000171756152: 1,\n",
       " 460016727624312: 1,\n",
       " 460018974067334: 1,\n",
       " 460029893741190: 1,\n",
       " 460010862512776: 1,\n",
       " 460045960907402: 1,\n",
       " 460010302114442: 1,\n",
       " 460015176518294: 1,\n",
       " 460016826223255: 1,\n",
       " 460017046981272: 1,\n",
       " 460011578624666: 1,\n",
       " 460013971016348: 1,\n",
       " 460065524026012: 1,\n",
       " 460018796989091: 1,\n",
       " 460065524026034: 1,\n",
       " 460004839066290: 1,\n",
       " 460014976633529: 1,\n",
       " 460110697106107: 1,\n",
       " 460110414547648: 1,\n",
       " 460004202121921: 1,\n",
       " 460065524026052: 1,\n",
       " 460004202121925: 1,\n",
       " 454120416447177: 1,\n",
       " 460003553282765: 1,\n",
       " 460016885205714: 1,\n",
       " 460077688720086: 1,\n",
       " 460065524026070: 1,\n",
       " 460011021372125: 1,\n",
       " 460001112132318: 1,\n",
       " 460018862918374: 1,\n",
       " 460000490326759: 1,\n",
       " 460001921927913: 1,\n",
       " 460013000100598: 1,\n",
       " 460019144231682: 1,\n",
       " 460016692071171: 1,\n",
       " 460110959545091: 1,\n",
       " 460002606713608: 1,\n",
       " 460016437529353: 1,\n",
       " 460065524026122: 1,\n",
       " 460009005648652: 1,\n",
       " 460110410877709: 1,\n",
       " 460110459177745: 1,\n",
       " 460065004063506: 1,\n",
       " 460069127064339: 1,\n",
       " 460015547616024: 1,\n",
       " 460110418774811: 1,\n",
       " 460014253902620: 1,\n",
       " 460015682325281: 1,\n",
       " 460015767751459: 1,\n",
       " 460000182668067: 1,\n",
       " 460015736621859: 1,\n",
       " 460000350145328: 1,\n",
       " 460004780575537: 1,\n",
       " 460004202122033: 1,\n",
       " 460017365617467: 1,\n",
       " 460013010651964: 1,\n",
       " 460023020981060: 1,\n",
       " 460015486110535: 1,\n",
       " 460110415039311: 1,\n",
       " 460000201739094: 1,\n",
       " 460014844939101: 1,\n",
       " 460000380947302: 1,\n",
       " 460013080513382: 1,\n",
       " 460065524026218: 1,\n",
       " 466924132830058: 1,\n",
       " 460000156158827: 1,\n",
       " 460020334136173: 1,\n",
       " 460065524026222: 1,\n",
       " 460013404916597: 1,\n",
       " 460004202122104: 1,\n",
       " 460040626506621: 1,\n",
       " 460110414580607: 1,\n",
       " 460110454983555: 1,\n",
       " 460002581678983: 1,\n",
       " 460015046527880: 1,\n",
       " 460015846525841: 1,\n",
       " 460093020015506: 1,\n",
       " 460110410582931: 1,\n",
       " 460004202122137: 1,\n",
       " 460110923893658: 1,\n",
       " 460018258512802: 1,\n",
       " 460065524026274: 1,\n",
       " 460110415170472: 1,\n",
       " 460110414580649: 1,\n",
       " 460004202122156: 1,\n",
       " 460065524026284: 1,\n",
       " 460110697106356: 1,\n",
       " 460025408031674: 1,\n",
       " 460019916966843: 1,\n",
       " 460018998610881: 1,\n",
       " 460065524026307: 1,\n",
       " 460020714245061: 1,\n",
       " 460040626506696: 1,\n",
       " 460092081015754: 1,\n",
       " 460016666512330: 1,\n",
       " 460016407514058: 1,\n",
       " 460000780159950: 1,\n",
       " 460002981120977: 1,\n",
       " 460019984108499: 1,\n",
       " 460110413499350: 1,\n",
       " 460022013463514: 1,\n",
       " 460069127031785: 1,\n",
       " 460002815511529: 1,\n",
       " 460110418512880: 1,\n",
       " 460015696219123: 1,\n",
       " 460011427105783: 1,\n",
       " 460110265781240: 1,\n",
       " 460020186057724: 1,\n",
       " 460018958699520: 1,\n",
       " 460018822974469: 1,\n",
       " 460005342186504: 1,\n",
       " 460015177305096: 1,\n",
       " 460015876508682: 1,\n",
       " 460042204908554: 1,\n",
       " 460016666512397: 1,\n",
       " 460110412581907: 1,\n",
       " 460018948672532: 1,\n",
       " 460075168500764: 1,\n",
       " 460110416809000: 1,\n",
       " 460015168425003: 1,\n",
       " 460013090507820: 1,\n",
       " 460004202122285: 1,\n",
       " 460002591378475: 1,\n",
       " 460013992643631: 1,\n",
       " 460004202122295: 1,\n",
       " 460018948672569: 1,\n",
       " 460045960907844: 1,\n",
       " 454001060219976: 1,\n",
       " 460079373487177: 1,\n",
       " 460015472020555: 1,\n",
       " 460110247791697: 1,\n",
       " 460029894593627: 1,\n",
       " 460004850535515: 1,\n",
       " 460003773779035: 1,\n",
       " 460093090008159: 1,\n",
       " 454197290044520: 1,\n",
       " 460026007161967: 1,\n",
       " 460091162070129: 1,\n",
       " 460010207612018: 1,\n",
       " 460110415203443: 1,\n",
       " 460018172660853: 1,\n",
       " 460016666610807: 1,\n",
       " 460110411500665: 1,\n",
       " 460010388622457: 1,\n",
       " 460016256519292: 1,\n",
       " 460016666610814: 1,\n",
       " 460097520110725: 1,\n",
       " 460004202122378: 1,\n",
       " 460110411336842: 1,\n",
       " 460003882175628: 1,\n",
       " 460000030166156: 1,\n",
       " 460028125875350: 1,\n",
       " 460110415662233: 1,\n",
       " 460020209683621: 1,\n",
       " 460110821821607: 1,\n",
       " 460000146623663: 1,\n",
       " 460000840125621: 1,\n",
       " 460010872507577: 1,\n",
       " 460078985612480: 1,\n",
       " 460012268620993: 1,\n",
       " 460012318624968: 1,\n",
       " 460098960002260: 1,\n",
       " 460004922952916: 1,\n",
       " 460004260351190: 1,\n",
       " 460015767751896: 1,\n",
       " 460004970532059: 1,\n",
       " 460110802947295: 1,\n",
       " 460016687647971: 1,\n",
       " 460019864046820: 1,\n",
       " 460069007035625: 1,\n",
       " 460012408671465: 1,\n",
       " 460016626502901: 1,\n",
       " 460010909502709: 1,\n",
       " 460110759595253: 1,\n",
       " 460018326605056: 1,\n",
       " 460007850380549: 1,\n",
       " 460002319731974: 1,\n",
       " 460110415432980: 1,\n",
       " 460110413008153: 1,\n",
       " 460019572509980: 1,\n",
       " 460013534973214: 1,\n",
       " 460020174621985: 1,\n",
       " 460095192108326: 1,\n",
       " 466924250205478: 1,\n",
       " 460029893381417: 1,\n",
       " 460029143911725: 1,\n",
       " 460029866413371: 1,\n",
       " 460028207729980: 1,\n",
       " 460010312109373: 1,\n",
       " 460001681935678: 1,\n",
       " 460014888619327: 1,\n",
       " 460075943005505: 1,\n",
       " 460020846398787: 1,\n",
       " 460013010685253: 1,\n",
       " 460000650988876: 1,\n",
       " 460069007035736: 1,\n",
       " 460110448495961: 1,\n",
       " 460110725549401: 1,\n",
       " 460015450066264: 1,\n",
       " 460016986033499: 1,\n",
       " 460018778606947: 1,\n",
       " 460069127032165: 1,\n",
       " 460018698620272: 1,\n",
       " 460029866413429: 1,\n",
       " 460028138425719: 1,\n",
       " 460029995093368: 1,\n",
       " 460000970313092: 1,\n",
       " 460018638622095: 1,\n",
       " 460010812509584: 1,\n",
       " 460002851327385: 1,\n",
       " 460008532938140: 1,\n",
       " 460110417726892: 1,\n",
       " 460016032222637: 1,\n",
       " 460011133504941: 1,\n",
       " 460110413794745: 1,\n",
       " 460015472020923: 1,\n",
       " 460011518627266: 1,\n",
       " 460007890390473: 1,\n",
       " 460007686409674: 1,\n",
       " 460018948115919: 1,\n",
       " 460015856618963: 1,\n",
       " 460018708516313: 1,\n",
       " 460029141028314: 1,\n",
       " 460079750712795: 1,\n",
       " 460000581389804: 1,\n",
       " 460014956613102: 1,\n",
       " 460001102597615: 1,\n",
       " 460001941982712: 1,\n",
       " 460002261634553: 1,\n",
       " 460069007035900: 1,\n",
       " 460016106114567: 1,\n",
       " 460001711918599: 1,\n",
       " 460045960908296: 1,\n",
       " 460110388497932: 1,\n",
       " 460110445940238: 1,\n",
       " 460078641516049: 1,\n",
       " 460001411567122: 1,\n",
       " 460010855501331: 1,\n",
       " 460018541268500: 1,\n",
       " 460069007035935: 1,\n",
       " 460002606812717: 1,\n",
       " 460016126103087: 1,\n",
       " 460016667627061: 1,\n",
       " 460000282611260: 1,\n",
       " 460002215104061: 1,\n",
       " 460000940330562: 1,\n",
       " 460077079793221: 1,\n",
       " 460015886208581: 1,\n",
       " 460015557611087: 1,\n",
       " 460009771961941: 1,\n",
       " 460006815010394: 1,\n",
       " 460009781988957: 1,\n",
       " 460028896218719: 1,\n",
       " 460003762212453: 1,\n",
       " 460002851327591: 1,\n",
       " ...}"
      ]
     },
     "execution_count": 141,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "for each in [leaver_code, permanent_code, commer_code]:\n",
    "    coder.update(each)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['statues'] = data.imsi_.map(coder)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.0    166220\n",
       "0.0     59194\n",
       "1.0     26460\n",
       "Name: statues, dtype: int64"
      ]
     },
     "execution_count": 145,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['statues'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.2567852274135581"
      ]
     },
     "execution_count": 147,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['statues'].isnull().mean() # 为什么没有全部取到？因为时间周期没有遍历完"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "metadata": {},
   "outputs": [],
   "source": [
    "t1 = {1,2,3}\n",
    "t2 = {2,3,4,5}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{1}"
      ]
     },
     "execution_count": 149,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t1 - t2 # 新离网"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{4, 5}"
      ]
     },
     "execution_count": 150,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t2 - t1 # 新入网"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{2, 3}"
      ]
     },
     "execution_count": 151,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t1 & t2 # 常驻用户"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 152,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 所以应该建立个时间列表，然后遍历这些时间，将时间切片好"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>imsi_</th>\n",
       "      <th>update_time_</th>\n",
       "      <th>lac_</th>\n",
       "      <th>cellid_</th>\n",
       "      <th>status_</th>\n",
       "      <th>ap_type_</th>\n",
       "      <th>device_id_</th>\n",
       "      <th>eventid_</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>update_time_</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:29</th>\n",
       "      <td>460110413044304</td>\n",
       "      <td>2019-05-08 20:09:29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:41</th>\n",
       "      <td>460110413042577</td>\n",
       "      <td>2019-05-08 20:09:41</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:14</th>\n",
       "      <td>460110425023300</td>\n",
       "      <td>2019-05-08 20:10:14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:40</th>\n",
       "      <td>460110714141865</td>\n",
       "      <td>2019-05-08 20:10:40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:08:55</th>\n",
       "      <td>460016692088409</td>\n",
       "      <td>2019-05-08 20:08:55</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                               imsi_         update_time_  lac_  cellid_  \\\n",
       "update_time_                                                               \n",
       "2019-05-08 20:09:29  460110413044304  2019-05-08 20:09:29     0        0   \n",
       "2019-05-08 20:09:41  460110413042577  2019-05-08 20:09:41     0        0   \n",
       "2019-05-08 20:10:14  460110425023300  2019-05-08 20:10:14     0        0   \n",
       "2019-05-08 20:10:40  460110714141865  2019-05-08 20:10:40     0        0   \n",
       "2019-05-08 20:08:55  460016692088409  2019-05-08 20:08:55     0        0   \n",
       "\n",
       "                    status_ ap_type_  device_id_    eventid_  \n",
       "update_time_                                                  \n",
       "2019-05-08 20:09:29      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:09:41      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:10:14      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:10:40      拒绝  FDD-LTE  DX-SZSC001  Normal Lau  \n",
       "2019-05-08 20:08:55      拒绝  FDD-LTE  LT-SZSC001  Normal Lau  "
      ]
     },
     "execution_count": 162,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 175,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]"
      ]
     },
     "execution_count": 175,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t = list(set(data.index.day))\n",
    "t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 180,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[8, 9, 10], [11, 12, 13], [14, 15, 16], [17, 18, 19], [20, 21, 22], [23, 24]]"
      ]
     },
     "execution_count": 180,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 这样就切片好了\n",
    "# 但如果是不同月份的话，还需要改进，先实现功能再说\n",
    "length = len(t)\n",
    "res = []\n",
    "i = 0\n",
    "while i + window < length:\n",
    "    res.append(t[i:i+window])\n",
    "    i = i + window\n",
    "res.append(t[i:])\n",
    "res"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11 14\n",
      "14 17\n",
      "17 20\n",
      "20 23\n",
      "23 26\n"
     ]
    }
   ],
   "source": [
    "# 初步调试\n",
    "year = data.index.year.min()\n",
    "month = data.index.month.min()\n",
    "day = data.index.day.min() # 本来不加min返回的是所有年份\n",
    "time1 = datetime.datetime(year, month, day)\n",
    "\n",
    "time_window = datetime.timedelta(days=window)\n",
    "\n",
    "time2 = (time1 + time_window)\n",
    "# 将时间类型数据转换成字符串\n",
    "stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "\n",
    "# imsi = data.imsi_.loc[stime1:stime2]\n",
    "\n",
    "base_user = set(data.imsi_.loc[stime1:stime2])\n",
    "\n",
    "d = {}\n",
    "d.update(dict(zip(base_user, [0]*len(base_user))))\n",
    "\n",
    "while time1.day + window < data.index.day.max(): # 不用担心超过时间区间\n",
    "    time1, time2 = time2, time2 + time_window\n",
    "    print(time1.day, time2.day)\n",
    "    stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "    user = set(data.imsi_.loc[stime1:stime2])\n",
    "    d.update(dict(zip(user, [0]*len(user))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 191,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2019-05-24 22:39:04')"
      ]
     },
     "execution_count": 191,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 185,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 185,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time1.day"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "92509"
      ]
     },
     "execution_count": 199,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 188,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "277489"
      ]
     },
     "execution_count": 188,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(set(data.index)) # 为什么所有用户id没对上"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 初步调试\n",
    "year = data.index.year.min()\n",
    "month = data.index.month.min()\n",
    "day = data.index.day.min() # 本来不加min返回的是所有年份\n",
    "time1 = datetime.datetime(year, month, day)\n",
    "\n",
    "time_window = datetime.timedelta(days=window)\n",
    "\n",
    "time2 = (time1 + time_window)\n",
    "# 将时间类型数据转换成字符串\n",
    "stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "\n",
    "data.imsi_.loc[stime1:stime2]\n",
    "\n",
    "base_user = set(data.imsi_.loc[stime1:stime2])\n",
    "\n",
    "time1, time2 = time2, time1 + time_window\n",
    "stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "user = set(data.imsi_.loc[stime1:stime2])\n",
    "new_leaver = base_user - user # 注意集合运算的顺序 1 新离网\n",
    "permanent = base_user & user # 2 常驻用户\n",
    "new_commer = user - base_user # 0 新入网"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14134"
      ]
     },
     "execution_count": 203,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(new_commer)+len(new_leaver)+len(permanent)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14134"
      ]
     },
     "execution_count": 204,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(base_user) + len(user) # 两个数据都对的到，说明可以的e，接下来时间滑动就好了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 303,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 完整调试\n",
    "year = data.index.year.min()\n",
    "month = data.index.month.min()\n",
    "day = data.index.day.min() # 本来不加min返回的是所有年份\n",
    "time1 = datetime.datetime(year, month, day)\n",
    "\n",
    "time_window = datetime.timedelta(days=window) # 这样可以直接和时间数据相加\n",
    "\n",
    "time2 = (time1 + time_window)\n",
    "# 将时间类型数据转换成字符串\n",
    "stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "\n",
    "# data.imsi_.loc[stime1:stime2]\n",
    "d = {}\n",
    "base_user = set(data.imsi_.loc[stime1:stime2])A\n",
    "while time1.day + window <= data.index.day.max():\n",
    "    time1, time2 = time2, time2 + time_window\n",
    "    stime1, stime2 = time1.strftime(format='%Y-%m-%d %H:%M:%S'), time2.strftime(format='%Y-%m-%d %H:%M:%S')\n",
    "    user = set(data.imsi_.loc[stime1:stime2]) # 新用户\n",
    "    new_leaver = base_user - user # 注意集合运算的顺序 1 新离网\n",
    "    permanent = base_user & user # 2 常驻用户\n",
    "    new_commer = user - base_user # 0 新入网\n",
    "    base_user.update(user)\n",
    "    d.update(dict(zip(new_leaver, len(new_leaver)*[1])))\n",
    "    d.update(dict(zip(new_commer, len(new_commer)*[0])))\n",
    "    d.update(dict(zip(permanent, len(permanent)*[2])))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 304,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['status'] = data.imsi_.map(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 306,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 306,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.status.isnull().sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "metadata": {},
   "outputs": [],
   "source": [
    "data['status'] = data.imsi_.map(d)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "664908"
      ]
     },
     "execution_count": 215,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.status.count() + data.status.isnull().count() # 怎么缺了这么多数据，会不会是因为时间的区间开闭出现问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 214,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "277489"
      ]
     },
     "execution_count": 214,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(set(data.index))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 216,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Timestamp('2019-05-08 20:08:55')"
      ]
     },
     "execution_count": 216,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.index.min()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 249,
   "metadata": {},
   "outputs": [],
   "source": [
    "s1 = set(data.imsi_['2019-5-8':'2019-5-11'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 248,
   "metadata": {},
   "outputs": [],
   "source": [
    "s2 = set(data.imsi_['2019-5-12':'2019-5-14'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 266,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "42338"
      ]
     },
     "execution_count": 266,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(set(data.imsi_['2019-5-8':'2019-5-14']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 251,
   "metadata": {},
   "outputs": [],
   "source": [
    "s1.update(s2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 252,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "42338"
      ]
     },
     "execution_count": 252,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(s1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 267,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "42338"
      ]
     },
     "execution_count": 267,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 检查下数据为什么少了这么多。可以发现在第二个循环开始缺少数据的\n",
    "\n",
    "t1 = s1 - s2\n",
    "t2 = s2 - s1\n",
    "t3 = s1 & s2\n",
    "len(t1) + len(t2) + len(t3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 268,
   "metadata": {},
   "outputs": [],
   "source": [
    "s3 = set(data.imsi_['2019-5-15':'2019-5-18'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 269,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "28702"
      ]
     },
     "execution_count": 269,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(s3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 278,
   "metadata": {},
   "outputs": [],
   "source": [
    "s = set()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 279,
   "metadata": {},
   "outputs": [],
   "source": [
    "s.update(s1)\n",
    "s.update(s2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 280,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "42338"
      ]
     },
     "execution_count": 280,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 281,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "61748"
      ]
     },
     "execution_count": 281,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t1 = s1 - s3\n",
    "t2 = s3 - s1\n",
    "t3 = s1 & s3\n",
    "len(t1) + len(t2) + len(t3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 273,
   "metadata": {},
   "outputs": [],
   "source": [
    "s.update(s3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 275,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "61748"
      ]
     },
     "execution_count": 275,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 300,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "14134"
      ]
     },
     "execution_count": 300,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(set(data.imsi_[:'2019-5-10']))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 287,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Series([], Name: imsi_, dtype: int64)"
      ]
     },
     "execution_count": 287,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.imsi_.loc[stime1:stime2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 288,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2019-05-24 00:00:00'"
      ]
     },
     "execution_count": 288,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stime1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 322,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2    187829\n",
       "1    138181\n",
       "0     12888\n",
       "Name: status, dtype: int64"
      ]
     },
     "execution_count": 322,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.status.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 323,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>imsi_</th>\n",
       "      <th>update_time_</th>\n",
       "      <th>lac_</th>\n",
       "      <th>cellid_</th>\n",
       "      <th>status_</th>\n",
       "      <th>ap_type_</th>\n",
       "      <th>device_id_</th>\n",
       "      <th>eventid_</th>\n",
       "      <th>status</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>update_time_</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:29</th>\n",
       "      <td>460110413044304</td>\n",
       "      <td>2019-05-08 20:09:29</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:09:41</th>\n",
       "      <td>460110413042577</td>\n",
       "      <td>2019-05-08 20:09:41</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:14</th>\n",
       "      <td>460110425023300</td>\n",
       "      <td>2019-05-08 20:10:14</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:10:40</th>\n",
       "      <td>460110714141865</td>\n",
       "      <td>2019-05-08 20:10:40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>DX-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-08 20:08:55</th>\n",
       "      <td>460016692088409</td>\n",
       "      <td>2019-05-08 20:08:55</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>拒绝</td>\n",
       "      <td>FDD-LTE</td>\n",
       "      <td>LT-SZSC001</td>\n",
       "      <td>Normal Lau</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                               imsi_         update_time_  lac_  cellid_  \\\n",
       "update_time_                                                               \n",
       "2019-05-08 20:09:29  460110413044304  2019-05-08 20:09:29     0        0   \n",
       "2019-05-08 20:09:41  460110413042577  2019-05-08 20:09:41     0        0   \n",
       "2019-05-08 20:10:14  460110425023300  2019-05-08 20:10:14     0        0   \n",
       "2019-05-08 20:10:40  460110714141865  2019-05-08 20:10:40     0        0   \n",
       "2019-05-08 20:08:55  460016692088409  2019-05-08 20:08:55     0        0   \n",
       "\n",
       "                    status_ ap_type_  device_id_    eventid_  status  \n",
       "update_time_                                                          \n",
       "2019-05-08 20:09:29      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       2  \n",
       "2019-05-08 20:09:41      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       1  \n",
       "2019-05-08 20:10:14      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       1  \n",
       "2019-05-08 20:10:40      拒绝  FDD-LTE  DX-SZSC001  Normal Lau       2  \n",
       "2019-05-08 20:08:55      拒绝  FDD-LTE  LT-SZSC001  Normal Lau       2  "
      ]
     },
     "execution_count": 323,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 324,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{460069107007489: 1,\n",
       " 460017051631619: 1,\n",
       " 460110411595787: 1,\n",
       " 460012348604444: 1,\n",
       " 460078194425886: 1,\n",
       " 460016087629858: 1,\n",
       " 460007444250659: 2,\n",
       " 460090842120226: 1,\n",
       " 460015316107305: 1,\n",
       " 460016291610665: 1,\n",
       " 460023116398641: 1,\n",
       " 460071791657011: 1,\n",
       " 460110411399223: 1,\n",
       " 460007392673852: 1,\n",
       " 460071791657020: 2,\n",
       " 460110410776637: 1,\n",
       " 460002601893952: 2,\n",
       " 460021606711373: 1,\n",
       " 460022200664143: 1,\n",
       " 460009190391888: 2,\n",
       " 460013573505104: 1,\n",
       " 460006851838031: 1,\n",
       " 460016637509718: 1,\n",
       " 460045960904799: 1,\n",
       " 460018862915684: 1,\n",
       " 460000500318309: 1,\n",
       " 460012048613480: 1,\n",
       " 460078237253736: 1,\n",
       " 460110412841067: 1,\n",
       " 460000970178667: 1,\n",
       " 460017912316013: 1,\n",
       " 460018678202482: 1,\n",
       " 460016667623541: 1,\n",
       " 460015440035959: 1,\n",
       " 460110411858040: 1,\n",
       " 460018486607999: 2,\n",
       " 460016840016001: 1,\n",
       " 460002321563780: 2,\n",
       " 460010190504071: 1,\n",
       " 460002306850951: 1,\n",
       " 460010420502665: 1,\n",
       " 460093020012682: 1,\n",
       " 460012268617866: 1,\n",
       " 460110415069326: 1,\n",
       " 460017227628687: 1,\n",
       " 460110714175631: 1,\n",
       " 460110959214737: 1,\n",
       " 460000146620562: 2,\n",
       " 460000840155283: 1,\n",
       " 460002606907544: 1,\n",
       " 460110414774424: 1,\n",
       " 460028137275548: 1,\n",
       " 460002251669665: 1,\n",
       " 460110381285546: 1,\n",
       " 460000015155372: 1,\n",
       " 460012989939885: 1,\n",
       " 460010302111922: 1,\n",
       " 460018009505971: 2,\n",
       " 460024967102647: 1,\n",
       " 460077295141048: 1,\n",
       " 460097990000835: 1,\n",
       " 460009781952715: 1,\n",
       " 460016407511249: 2,\n",
       " 460014112571605: 1,\n",
       " 460110410809558: 1,\n",
       " 460110339375318: 1,\n",
       " 460079373320405: 1,\n",
       " 460006841876696: 1,\n",
       " 460013030113499: 1,\n",
       " 460015557509340: 1,\n",
       " 460003193290975: 1,\n",
       " 460016562307300: 2,\n",
       " 460011179704548: 1,\n",
       " 460075927109869: 1,\n",
       " 460018964005103: 1,\n",
       " 460018888605939: 1,\n",
       " 460000930332919: 1,\n",
       " 460011337220354: 1,\n",
       " 460007741686018: 1,\n",
       " 460020185792772: 2,\n",
       " 460003006710020: 1,\n",
       " 460002641838342: 1,\n",
       " 460061001023751: 1,\n",
       " 460029271179524: 1,\n",
       " 460013277708553: 1,\n",
       " 460011481104649: 1,\n",
       " 460018984026384: 1,\n",
       " 460060062089503: 1,\n",
       " 460015567601957: 1,\n",
       " 460011895619884: 1,\n",
       " 460027801829678: 1,\n",
       " 460029198369071: 1,\n",
       " 460060062089521: 1,\n",
       " 460060062089522: 1,\n",
       " 460060062089527: 1,\n",
       " 460002506768702: 1,\n",
       " 460018208506175: 1,\n",
       " 460110364803393: 1,\n",
       " 460029020766532: 1,\n",
       " 460016907059524: 1,\n",
       " 460110959378760: 2,\n",
       " 460060062089547: 1,\n",
       " 460014487634254: 1,\n",
       " 460110394130769: 1,\n",
       " 460015677505877: 1,\n",
       " 460099511779669: 1,\n",
       " 460019074203991: 1,\n",
       " 460060062089560: 1,\n",
       " 460015733965148: 1,\n",
       " 460077707559262: 1,\n",
       " 460028211593572: 1,\n",
       " 460010841604452: 1,\n",
       " 460018559123812: 1,\n",
       " 460029903634794: 1,\n",
       " 460110663778667: 1,\n",
       " 460060062089587: 1,\n",
       " 460095167103347: 1,\n",
       " 460000191742338: 1,\n",
       " 460015316107652: 1,\n",
       " 460110959542667: 1,\n",
       " 460018948604310: 1,\n",
       " 460110412087711: 1,\n",
       " 460061071016353: 2,\n",
       " 460019394019751: 1,\n",
       " 460012680511913: 1,\n",
       " 460017191616950: 1,\n",
       " 460017064935871: 1,\n",
       " 460002901328327: 2,\n",
       " 460002891366868: 1,\n",
       " 460015547515356: 1,\n",
       " 460011792105948: 1,\n",
       " 460002581348831: 2,\n",
       " 460014165623270: 1,\n",
       " 460110869266924: 1,\n",
       " 460014986658285: 1,\n",
       " 460002218246636: 1,\n",
       " 460010623402479: 1,\n",
       " 460002621882863: 1,\n",
       " 460015310504432: 1,\n",
       " 460110869627381: 1,\n",
       " 460009383854581: 1,\n",
       " 460002971156989: 1,\n",
       " 460110413431295: 2,\n",
       " 460029140763142: 1,\n",
       " 460018258510348: 1,\n",
       " 460028174729740: 1,\n",
       " 454006109110798: 1,\n",
       " 460010688610829: 2,\n",
       " 460069087052302: 1,\n",
       " 460000392610320: 1,\n",
       " 460002676146704: 1,\n",
       " 460110415790613: 1,\n",
       " 460016296526368: 1,\n",
       " 460018908103207: 2,\n",
       " 460015026602540: 2,\n",
       " 460015557607981: 1,\n",
       " 460017644241454: 1,\n",
       " 460023128851005: 1,\n",
       " 460110411235901: 2,\n",
       " 460110410744388: 1,\n",
       " 460019522503244: 1,\n",
       " 460019239912013: 1,\n",
       " 460012490687055: 1,\n",
       " 460001693794897: 1,\n",
       " 460016727622232: 1,\n",
       " 460004312285784: 1,\n",
       " 460099038806618: 1,\n",
       " 460003732161116: 1,\n",
       " 460020287996509: 1,\n",
       " 460012812304990: 2,\n",
       " 460017707942498: 1,\n",
       " 460020308574822: 1,\n",
       " 460026175324777: 1,\n",
       " 460028755378798: 1,\n",
       " 460012890096243: 1,\n",
       " 460113324245624: 1,\n",
       " 460110724268665: 1,\n",
       " 460110414119546: 1,\n",
       " 460012960318086: 2,\n",
       " 460014827602567: 1,\n",
       " 460110080180873: 1,\n",
       " 460000330154636: 1,\n",
       " 460002381824652: 1,\n",
       " 460018351047308: 1,\n",
       " 460110797865617: 2,\n",
       " 460017176248980: 2,\n",
       " 460078983578270: 1,\n",
       " 460015717679797: 1,\n",
       " 460015292318391: 2,\n",
       " 460069087052480: 1,\n",
       " 460002631877313: 1,\n",
       " 460000060113602: 1,\n",
       " 460110411006665: 1,\n",
       " 460001701987023: 1,\n",
       " 460003872113360: 1,\n",
       " 460000146621137: 1,\n",
       " 460000146522836: 2,\n",
       " 460015292318428: 1,\n",
       " 460004830577373: 1,\n",
       " 460078228931294: 1,\n",
       " 460110417527528: 1,\n",
       " 460023179182825: 1,\n",
       " 460016637510380: 1,\n",
       " 450050990047985: 1,\n",
       " 460015292318452: 2,\n",
       " 460018998608640: 1,\n",
       " 460110672429833: 1,\n",
       " 460016797614858: 1,\n",
       " 460113328046862: 1,\n",
       " 460075949032214: 1,\n",
       " 460000055034661: 1,\n",
       " 460015292318505: 1,\n",
       " 460110413005610: 1,\n",
       " 460029198369579: 2,\n",
       " 460021124367149: 1,\n",
       " 460015292318513: 1,\n",
       " 460018822972213: 1,\n",
       " 460095167103799: 1,\n",
       " 460078115455799: 1,\n",
       " 460000201737031: 1,\n",
       " 460017031643976: 1,\n",
       " 460002911388491: 1,\n",
       " 460003193291596: 2,\n",
       " 460110412809036: 1,\n",
       " 460000373179216: 1,\n",
       " 460110414971729: 1,\n",
       " 460013257753433: 1,\n",
       " 460015812346713: 1,\n",
       " 460018064032614: 1,\n",
       " 460093020013419: 1,\n",
       " 460110419329902: 1,\n",
       " 460000500351856: 1,\n",
       " 460028207727473: 1,\n",
       " 460092031009651: 1,\n",
       " 460004961878900: 1,\n",
       " 460110162494333: 1,\n",
       " 460078209860478: 2,\n",
       " 460007972275077: 1,\n",
       " 460069007033222: 1,\n",
       " 460016766518151: 1,\n",
       " 460093020013453: 1,\n",
       " 460003160425358: 1,\n",
       " 460015266104213: 1,\n",
       " 460000272548763: 1,\n",
       " 460017310991262: 1,\n",
       " 460000970310559: 1,\n",
       " 460002841363363: 2,\n",
       " 460110443905955: 1,\n",
       " 460029212525476: 2,\n",
       " 460018708612005: 1,\n",
       " 460110339310506: 1,\n",
       " 460071065125805: 2,\n",
       " 460008922219442: 1,\n",
       " 460010884039604: 2,\n",
       " 460003562193849: 1,\n",
       " 460012228608954: 1,\n",
       " 460093020013499: 1,\n",
       " 460110419395514: 1,\n",
       " 460028147139520: 1,\n",
       " 460007880360905: 2,\n",
       " 460019623625675: 1,\n",
       " 460017907729367: 1,\n",
       " 460002631746520: 1,\n",
       " 460110438761433: 1,\n",
       " 460010362110940: 1,\n",
       " 460061081043935: 2,\n",
       " 460012088624103: 1,\n",
       " 460016607527914: 1,\n",
       " 460069047010285: 1,\n",
       " 460078201635822: 1,\n",
       " 460023128032240: 1,\n",
       " 460006653297649: 1,\n",
       " 460025001280498: 1,\n",
       " 460010388620275: 2,\n",
       " 460110413005821: 1,\n",
       " 460017725768704: 2,\n",
       " 460015547515912: 2,\n",
       " 460093347103752: 1,\n",
       " 460004352164874: 2,\n",
       " 460010352116748: 1,\n",
       " 460028893299727: 1,\n",
       " 460016870786065: 1,\n",
       " 460110415266835: 1,\n",
       " 460110416610326: 1,\n",
       " 460017982080025: 1,\n",
       " 460110417626140: 2,\n",
       " 460016666608676: 1,\n",
       " 460061001057322: 1,\n",
       " 460046658503735: 1,\n",
       " 460017161602112: 1,\n",
       " 460023136453701: 2,\n",
       " 460014576600135: 1,\n",
       " 460002841330765: 2,\n",
       " 460013352059982: 1,\n",
       " 460021125448781: 1,\n",
       " 460007172146259: 1,\n",
       " 460021180957779: 1,\n",
       " 460093090006104: 2,\n",
       " 460110730429531: 1,\n",
       " 460003193291867: 1,\n",
       " 460090419807336: 1,\n",
       " 460110410908782: 1,\n",
       " 460090472006766: 1,\n",
       " 460110351598704: 1,\n",
       " 460023134618742: 1,\n",
       " 460093090006136: 1,\n",
       " 460012198626425: 2,\n",
       " 460014306690170: 1,\n",
       " 460090992100477: 2,\n",
       " 460028186723466: 1,\n",
       " 460093090006159: 2,\n",
       " 460018353112207: 1,\n",
       " 460002431829138: 1,\n",
       " 460000274580629: 1,\n",
       " 460004872127637: 1,\n",
       " 460017272620186: 1,\n",
       " 460015540339869: 1,\n",
       " 460005243290781: 1,\n",
       " 460015316665509: 1,\n",
       " 460000060146860: 1,\n",
       " 460010388620462: 1,\n",
       " 460015537521842: 1,\n",
       " 460008800224436: 1,\n",
       " 460010360112311: 1,\n",
       " 460016890774714: 1,\n",
       " 460019038520506: 1,\n",
       " 460025583535292: 1,\n",
       " 460002431829183: 1,\n",
       " 460002431829185: 1,\n",
       " 460015616525508: 1,\n",
       " 460020558660805: 1,\n",
       " 460019532924104: 1,\n",
       " 460110784824524: 1,\n",
       " 460029894657229: 1,\n",
       " 460093040002264: 1,\n",
       " 460015170094299: 1,\n",
       " 460012408636635: 1,\n",
       " 460013070615773: 1,\n",
       " 460007344669924: 1,\n",
       " 460017580442854: 2,\n",
       " 460018796987624: 1,\n",
       " 460093090006251: 1,\n",
       " 460024061068523: 1,\n",
       " 460021123253487: 2,\n",
       " 460018840044789: 1,\n",
       " 460011448632566: 1,\n",
       " 460110413202678: 1,\n",
       " 460016797517049: 1,\n",
       " 460015466218751: 1,\n",
       " 460018994087170: 1,\n",
       " 460025209029891: 1,\n",
       " 460025066849540: 1,\n",
       " 460000060114180: 2,\n",
       " 460020238255364: 1,\n",
       " 460110396196103: 1,\n",
       " 460000055035151: 1,\n",
       " 460011088643355: 1,\n",
       " 460003016279324: 1,\n",
       " 460018804000037: 2,\n",
       " 460061011051814: 1,\n",
       " 460078430258470: 2,\n",
       " 460029140763944: 1,\n",
       " 460011448632621: 1,\n",
       " 460020242711856: 1,\n",
       " 460015237727545: 1,\n",
       " 460096160105789: 1,\n",
       " 460110457013571: 1,\n",
       " 460015537521988: 1,\n",
       " 460014844970309: 1,\n",
       " 460017121625414: 1,\n",
       " 460022193489224: 1,\n",
       " 460010388620619: 1,\n",
       " 460110415267147: 1,\n",
       " 460011117806924: 1,\n",
       " 460002841298252: 1,\n",
       " 460006584288597: 2,\n",
       " 460013736920409: 1,\n",
       " 460016010102113: 1,\n",
       " 460069069063524: 1,\n",
       " 460015257781607: 1,\n",
       " 460014794212717: 1,\n",
       " 460012802344303: 1,\n",
       " 460003533227376: 1,\n",
       " 460023138026865: 2,\n",
       " 460028755215730: 2,\n",
       " 460110416151934: 1,\n",
       " 460028186527102: 1,\n",
       " 460001102595458: 1,\n",
       " 460020805862788: 1,\n",
       " 460015566259589: 1,\n",
       " 460002606876040: 1,\n",
       " 460020241991051: 1,\n",
       " 460012222612877: 1,\n",
       " 460020185793936: 1,\n",
       " 460069087053201: 1,\n",
       " 460077575210398: 1,\n",
       " 460110205486495: 1,\n",
       " 460010162521503: 1,\n",
       " 460069087053218: 1,\n",
       " 460015557510562: 1,\n",
       " 460017725703587: 1,\n",
       " 460002981152168: 1,\n",
       " 460029198140845: 1,\n",
       " 460110869104046: 1,\n",
       " 460110396622255: 1,\n",
       " 460013129663923: 1,\n",
       " 460015747728826: 1,\n",
       " 460045960906172: 1,\n",
       " 460000680379840: 1,\n",
       " 460092041004492: 1,\n",
       " 460010322691548: 1,\n",
       " 460029867492828: 2,\n",
       " 460002781365733: 1,\n",
       " 460002606941669: 1,\n",
       " 460012495341029: 1,\n",
       " 460110797866472: 1,\n",
       " 460016972301797: 1,\n",
       " 460093090006506: 1,\n",
       " 460003742189049: 1,\n",
       " 460020109215230: 1,\n",
       " 460018778113538: 2,\n",
       " 460006972130819: 1,\n",
       " 460110413497870: 1,\n",
       " 460016890775064: 2,\n",
       " 460019072501283: 1,\n",
       " 460016627516970: 1,\n",
       " 460075888936497: 1,\n",
       " 460016196519483: 1,\n",
       " 460110414054972: 1,\n",
       " 460006742885949: 1,\n",
       " 460000930367049: 1,\n",
       " 460017141614156: 1,\n",
       " 460002665137751: 1,\n",
       " 460095032723041: 1,\n",
       " 460015816509031: 1,\n",
       " 460095337105000: 1,\n",
       " 460069107009129: 1,\n",
       " 460012802344557: 1,\n",
       " 460110413366896: 1,\n",
       " 460093030008435: 1,\n",
       " 460006523733624: 1,\n",
       " 460012078630521: 1,\n",
       " 460110412514946: 1,\n",
       " 460110413170307: 1,\n",
       " 460003782755974: 2,\n",
       " 460010422306443: 1,\n",
       " 460018850072204: 1,\n",
       " 460020240385680: 2,\n",
       " 460015996602002: 1,\n",
       " 460001993950871: 1,\n",
       " 460017371612824: 1,\n",
       " 460008912225946: 1,\n",
       " 460011508631196: 1,\n",
       " 460010082305698: 1,\n",
       " 460010382624420: 1,\n",
       " 460110413858469: 1,\n",
       " 460016747611814: 1,\n",
       " 460110414710451: 1,\n",
       " 460020106561203: 1,\n",
       " 460018739611319: 2,\n",
       " 460075206215357: 1,\n",
       " 460029141190335: 1,\n",
       " 460002581677762: 1,\n",
       " 460093030008516: 1,\n",
       " 460093080012488: 1,\n",
       " 460016216606409: 2,\n",
       " 460045960906444: 1,\n",
       " 460110407501521: 1,\n",
       " 460002319894226: 1,\n",
       " 460003330459348: 2,\n",
       " 460017840391893: 1,\n",
       " 460019854214870: 2,\n",
       " 460069047076566: 1,\n",
       " 460110418773725: 1,\n",
       " 460093520709343: 2,\n",
       " 460012248631008: 1,\n",
       " 460012661311200: 1,\n",
       " 460013464028909: 1,\n",
       " 460079747827438: 1,\n",
       " 460069087053556: 1,\n",
       " 460002771896054: 1,\n",
       " 460027766343422: 1,\n",
       " 460020106266372: 1,\n",
       " 460010362111748: 1,\n",
       " 460011963025157: 1,\n",
       " 460078107756293: 1,\n",
       " 460001941915403: 1,\n",
       " 460000510314256: 2,\n",
       " 460023076030224: 1,\n",
       " 460016216508183: 1,\n",
       " 460004800562973: 1,\n",
       " 460111151073065: 1,\n",
       " 460020354516779: 1,\n",
       " 460012288608049: 1,\n",
       " 460016464201525: 1,\n",
       " 460093030008637: 1,\n",
       " 460069107009345: 1,\n",
       " 460002073249604: 1,\n",
       " 460110416250694: 2,\n",
       " 460016736503622: 2,\n",
       " 460075382605640: 1,\n",
       " 460011780605769: 1,\n",
       " 460000091277131: 1,\n",
       " 460069839013713: 1,\n",
       " 460016204613463: 2,\n",
       " 460018922948443: 1,\n",
       " 460110413104988: 1,\n",
       " 460078946420577: 1,\n",
       " 460113328047970: 1,\n",
       " 460015796520801: 1,\n",
       " 460029893412707: 1,\n",
       " 460110415988581: 1,\n",
       " 460000370919274: 1,\n",
       " 460092041004908: 1,\n",
       " 460069047076724: 1,\n",
       " 460010862511988: 2,\n",
       " 460016660612980: 1,\n",
       " 460021124335482: 1,\n",
       " 460003183232893: 2,\n",
       " 460014280607617: 1,\n",
       " 460113328048002: 1,\n",
       " 460029894756231: 1,\n",
       " 460023134488458: 1,\n",
       " 460019112314771: 1,\n",
       " 460078887110549: 1,\n",
       " 460110410909590: 1,\n",
       " 460028896184218: 1,\n",
       " 460110804879265: 1,\n",
       " 460110411007913: 1,\n",
       " 460110192019377: 1,\n",
       " 460016627517363: 2,\n",
       " 460000421382068: 1,\n",
       " 460110701987771: 1,\n",
       " 460017011689409: 2,\n",
       " 460110416971714: 1,\n",
       " 460110410975171: 1,\n",
       " 460110814971848: 1,\n",
       " 460014936623051: 1,\n",
       " 460020353796048: 1,\n",
       " 460004770547665: 1,\n",
       " 460002319730647: 1,\n",
       " 460069839013849: 1,\n",
       " 460007464273885: 1,\n",
       " 460016737519584: 1,\n",
       " 460028743485417: 1,\n",
       " 460110751860718: 1,\n",
       " 460002841397232: 1,\n",
       " 460077120817137: 2,\n",
       " 460001920387058: 1,\n",
       " 460013756942330: 1,\n",
       " 460006574295037: 1,\n",
       " 460000710330366: 1,\n",
       " 460010802546690: 1,\n",
       " 460093090007044: 1,\n",
       " 460002815412229: 1,\n",
       " 460093090007046: 1,\n",
       " 460010042689546: 1,\n",
       " 454065216161807: 1,\n",
       " 460022170028054: 1,\n",
       " 460004960569366: 1,\n",
       " 460002591868952: 1,\n",
       " 460016116107295: 1,\n",
       " 460060550006822: 1,\n",
       " 460002241677351: 1,\n",
       " 460012934236203: 1,\n",
       " 460019098519598: 2,\n",
       " 460018922948657: 1,\n",
       " 460015291500594: 1,\n",
       " 460016787621938: 1,\n",
       " 460015547615284: 2,\n",
       " 460002319796280: 1,\n",
       " 460020810451005: 1,\n",
       " 460045960906818: 1,\n",
       " 460075063183438: 1,\n",
       " 460110355269710: 1,\n",
       " 460012831508560: 2,\n",
       " 460110414710864: 1,\n",
       " 460019028527186: 1,\n",
       " 460018643601504: 1,\n",
       " 460013090637921: 1,\n",
       " 460002815314020: 1,\n",
       " 460016244000868: 1,\n",
       " 460016996026470: 1,\n",
       " 460013788104814: 1,\n",
       " 460010414606447: 1,\n",
       " 460002606680178: 2,\n",
       " 460016677521523: 1,\n",
       " 460015292319859: 1,\n",
       " 460066544027766: 1,\n",
       " 460010432104576: 1,\n",
       " 460019916966017: 1,\n",
       " 460078983678082: 2,\n",
       " 460013060524166: 1,\n",
       " 460093090007174: 1,\n",
       " 460110417528972: 2,\n",
       " 460027681933458: 1,\n",
       " 460014796966038: 1,\n",
       " 460012078631069: 1,\n",
       " 460015696611485: 1,\n",
       " 460002506803369: 1,\n",
       " 460016497526957: 1,\n",
       " 460015336655024: 1,\n",
       " 460000845039796: 1,\n",
       " 460078194133175: 1,\n",
       " 460002492352698: 1,\n",
       " 460012862310593: 1,\n",
       " 460110129400009: 1,\n",
       " 460071791691978: 2,\n",
       " 460060055079113: 1,\n",
       " 460016046901452: 1,\n",
       " 460011458627793: 2,\n",
       " 460110413138131: 1,\n",
       " 460016866003157: 2,\n",
       " 460013350258905: 1,\n",
       " 460010378627294: 1,\n",
       " 460010311518431: 1,\n",
       " 460069047077098: 1,\n",
       " 460012930369771: 2,\n",
       " 460069047077104: 1,\n",
       " 454075240024310: 1,\n",
       " 460028112079097: 1,\n",
       " 460016666511609: 1,\n",
       " 460002601634046: 1,\n",
       " 460110746913030: 1,\n",
       " 460110420150536: 1,\n",
       " 460110364346642: 1,\n",
       " 460017520609555: 1,\n",
       " 460015202339096: 2,\n",
       " 460078243973417: 1,\n",
       " 460095202101547: 1,\n",
       " 460015616526636: 1,\n",
       " 460003016116525: 1,\n",
       " 460021790902573: 1,\n",
       " 460002371897647: 1,\n",
       " 460015326660910: 1,\n",
       " 460110414711090: 1,\n",
       " 460023136291122: 1,\n",
       " 460025125079348: 1,\n",
       " 460015237499189: 1,\n",
       " 460066544027954: 1,\n",
       " 460010676914485: 1,\n",
       " 460023236790588: 1,\n",
       " 460012318624062: 1,\n",
       " 460000020138303: 1,\n",
       " 460017982081345: 1,\n",
       " 460001681377607: 2,\n",
       " 460110411696458: 2,\n",
       " 220018003872080: 1,\n",
       " 460093090007378: 2,\n",
       " 460016631613779: 1,\n",
       " 310260309035353: 1,\n",
       " 460004312287579: 1,\n",
       " 460013020514654: 1,\n",
       " 460110725712222: 1,\n",
       " 460006684854633: 2,\n",
       " 460003543255403: 1,\n",
       " 460113311041900: 1,\n",
       " 460110402062702: 1,\n",
       " 460093080013168: 1,\n",
       " 460002914797938: 1,\n",
       " 460013267716469: 1,\n",
       " 460002941176186: 1,\n",
       " 460093090007425: 1,\n",
       " 460013942016390: 1,\n",
       " 460008240384396: 1,\n",
       " 460000055069070: 1,\n",
       " 460016600091050: 1,\n",
       " 460016600091052: 1,\n",
       " 460096090704302: 1,\n",
       " 460000030132654: 1,\n",
       " 460000146557358: 1,\n",
       " 460006240389553: 1,\n",
       " 460069839014331: 1,\n",
       " 460000860768701: 1,\n",
       " 460018832968129: 2,\n",
       " 460110505773509: 2,\n",
       " 460028174862793: 1,\n",
       " 460013641959887: 1,\n",
       " 460016757508559: 1,\n",
       " 460016286501331: 1,\n",
       " 460000170346964: 1,\n",
       " 460012308629980: 1,\n",
       " 460095142103520: 1,\n",
       " 460042204908003: 1,\n",
       " 460023192783335: 1,\n",
       " 460017041639912: 1,\n",
       " 460065524025837: 1,\n",
       " 460004343253486: 2,\n",
       " 460000146491888: 1,\n",
       " 460021125188081: 1,\n",
       " 454001060219383: 1,\n",
       " 460012308630008: 1,\n",
       " 460093317122553: 1,\n",
       " 460019936922107: 1,\n",
       " 460018904009217: 1,\n",
       " 460065524025859: 1,\n",
       " 460065524025860: 1,\n",
       " 460110955710982: 1,\n",
       " 460001125042695: 1,\n",
       " 460012984240646: 1,\n",
       " 460015537523207: 1,\n",
       " 460000060148234: 2,\n",
       " 460019098913294: 2,\n",
       " 460007464274459: 1,\n",
       " 460004322249248: 1,\n",
       " 460018678204961: 1,\n",
       " 460020308576803: 1,\n",
       " 460004202121764: 1,\n",
       " 460020101024291: 1,\n",
       " 460028896217639: 1,\n",
       " 460016552315433: 1,\n",
       " 460028896184877: 1,\n",
       " 460015326104109: 1,\n",
       " 460110297827887: 1,\n",
       " 460110413957683: 2,\n",
       " 460110713981494: 1,\n",
       " 460022071265848: 1,\n",
       " 460010510617145: 1,\n",
       " 460013020514873: 1,\n",
       " 460010878405179: 1,\n",
       " 460017369352765: 1,\n",
       " 460004202121791: 1,\n",
       " 460011765303873: 1,\n",
       " 460110714047043: 1,\n",
       " 460110249921093: 2,\n",
       " 460004202121801: 2,\n",
       " 460093040003658: 1,\n",
       " 460010352609870: 1,\n",
       " 460015856618064: 2,\n",
       " 460110014515794: 1,\n",
       " 460002694400594: 1,\n",
       " 460110869662293: 2,\n",
       " 460078136855125: 1,\n",
       " 460065524025943: 1,\n",
       " 460065524025946: 1,\n",
       " 460002922138204: 1,\n",
       " 460007890356829: 1,\n",
       " 460065524025954: 1,\n",
       " 460006544280167: 2,\n",
       " 460065524025962: 1,\n",
       " 460011765303916: 1,\n",
       " 460010077522542: 1,\n",
       " 460075227744878: 1,\n",
       " 460093040003696: 1,\n",
       " 460020185959031: 2,\n",
       " 460000171756152: 1,\n",
       " 460016727624312: 1,\n",
       " 460018974067334: 1,\n",
       " 460029893741190: 1,\n",
       " 460010862512776: 1,\n",
       " 460045960907402: 1,\n",
       " 460010302114442: 1,\n",
       " 460015176518294: 1,\n",
       " 460016826223255: 2,\n",
       " 460017046981272: 1,\n",
       " 460011578624666: 2,\n",
       " 460013971016348: 1,\n",
       " 460065524026012: 1,\n",
       " 460018796989091: 1,\n",
       " 460065524026034: 1,\n",
       " 460004839066290: 1,\n",
       " 460014976633529: 2,\n",
       " 460110697106107: 1,\n",
       " 460110414547648: 1,\n",
       " 460004202121921: 2,\n",
       " 460065524026052: 1,\n",
       " 460004202121925: 2,\n",
       " 454120416447177: 1,\n",
       " 460003553282765: 1,\n",
       " 460016885205714: 1,\n",
       " 460077688720086: 1,\n",
       " 460065524026070: 1,\n",
       " 460011021372125: 1,\n",
       " 460001112132318: 1,\n",
       " 460018862918374: 1,\n",
       " 460000490326759: 1,\n",
       " 460001921927913: 2,\n",
       " 460013000100598: 1,\n",
       " 460019144231682: 2,\n",
       " 460016692071171: 1,\n",
       " 460110959545091: 1,\n",
       " 460002606713608: 1,\n",
       " 460016437529353: 1,\n",
       " 460065524026122: 1,\n",
       " 460009005648652: 1,\n",
       " 460110410877709: 1,\n",
       " 460110459177745: 1,\n",
       " 460065004063506: 1,\n",
       " 460069127064339: 1,\n",
       " 460015547616024: 1,\n",
       " 460110418774811: 1,\n",
       " 460014253902620: 1,\n",
       " 460015682325281: 1,\n",
       " 460015767751459: 1,\n",
       " 460000182668067: 1,\n",
       " 460015736621859: 1,\n",
       " 460000350145328: 1,\n",
       " 460004780575537: 1,\n",
       " 460004202122033: 1,\n",
       " 460017365617467: 1,\n",
       " 460013010651964: 1,\n",
       " 460023020981060: 1,\n",
       " 460015486110535: 1,\n",
       " 460110415039311: 1,\n",
       " 460000201739094: 1,\n",
       " 460014844939101: 1,\n",
       " 460000380947302: 1,\n",
       " 460013080513382: 1,\n",
       " 460065524026218: 1,\n",
       " 466924132830058: 1,\n",
       " 460000156158827: 1,\n",
       " 460020334136173: 1,\n",
       " 460065524026222: 1,\n",
       " 460013404916597: 1,\n",
       " 460004202122104: 1,\n",
       " 460040626506621: 1,\n",
       " 460110414580607: 1,\n",
       " 460110454983555: 1,\n",
       " 460002581678983: 1,\n",
       " 460015046527880: 2,\n",
       " 460015846525841: 1,\n",
       " 460093020015506: 1,\n",
       " 460110410582931: 1,\n",
       " 460004202122137: 1,\n",
       " 460110923893658: 1,\n",
       " 460018258512802: 1,\n",
       " 460065524026274: 1,\n",
       " 460110415170472: 2,\n",
       " 460110414580649: 2,\n",
       " 460004202122156: 1,\n",
       " 460065524026284: 1,\n",
       " 460110697106356: 1,\n",
       " 460025408031674: 1,\n",
       " 460019916966843: 1,\n",
       " 460018998610881: 2,\n",
       " 460065524026307: 1,\n",
       " 460020714245061: 1,\n",
       " 460040626506696: 1,\n",
       " 460092081015754: 1,\n",
       " 460016666512330: 1,\n",
       " 460016407514058: 1,\n",
       " 460000780159950: 1,\n",
       " 460002981120977: 1,\n",
       " 460019984108499: 1,\n",
       " 460110413499350: 1,\n",
       " 460022013463514: 1,\n",
       " 460069127031785: 1,\n",
       " 460002815511529: 1,\n",
       " 460110418512880: 1,\n",
       " 460015696219123: 1,\n",
       " 460011427105783: 1,\n",
       " 460110265781240: 1,\n",
       " 460020186057724: 1,\n",
       " 460018958699520: 1,\n",
       " 460018822974469: 1,\n",
       " 460005342186504: 1,\n",
       " 460015177305096: 1,\n",
       " 460015876508682: 1,\n",
       " 460042204908554: 1,\n",
       " 460016666512397: 1,\n",
       " 460110412581907: 1,\n",
       " 460018948672532: 1,\n",
       " 460075168500764: 1,\n",
       " 460110416809000: 1,\n",
       " 460015168425003: 1,\n",
       " 460013090507820: 1,\n",
       " 460004202122285: 1,\n",
       " 460002591378475: 1,\n",
       " 460013992643631: 1,\n",
       " 460004202122295: 2,\n",
       " 460018948672569: 1,\n",
       " 460045960907844: 1,\n",
       " 454001060219976: 1,\n",
       " 460079373487177: 1,\n",
       " 460015472020555: 1,\n",
       " 460110247791697: 1,\n",
       " 460029894593627: 2,\n",
       " 460004850535515: 1,\n",
       " 460003773779035: 1,\n",
       " 460093090008159: 1,\n",
       " 454197290044520: 1,\n",
       " 460026007161967: 1,\n",
       " 460091162070129: 1,\n",
       " 460010207612018: 2,\n",
       " 460110415203443: 1,\n",
       " 460018172660853: 1,\n",
       " 460016666610807: 1,\n",
       " 460110411500665: 1,\n",
       " 460010388622457: 1,\n",
       " 460016256519292: 1,\n",
       " 460016666610814: 1,\n",
       " 460097520110725: 2,\n",
       " 460004202122378: 1,\n",
       " 460110411336842: 1,\n",
       " 460003882175628: 1,\n",
       " 460000030166156: 1,\n",
       " 460028125875350: 2,\n",
       " 460110415662233: 1,\n",
       " 460020209683621: 2,\n",
       " 460110821821607: 1,\n",
       " 460000146623663: 1,\n",
       " 460000840125621: 2,\n",
       " 460010872507577: 2,\n",
       " 460078985612480: 2,\n",
       " 460012268620993: 1,\n",
       " 460012318624968: 2,\n",
       " 460098960002260: 1,\n",
       " 460004922952916: 1,\n",
       " 460004260351190: 1,\n",
       " 460015767751896: 1,\n",
       " 460004970532059: 1,\n",
       " 460110802947295: 1,\n",
       " 460016687647971: 1,\n",
       " 460019864046820: 1,\n",
       " 460069007035625: 1,\n",
       " 460012408671465: 1,\n",
       " 460016626502901: 1,\n",
       " 460010909502709: 1,\n",
       " 460110759595253: 1,\n",
       " 460018326605056: 1,\n",
       " 460007850380549: 1,\n",
       " 460002319731974: 1,\n",
       " 460110415432980: 1,\n",
       " 460110413008153: 2,\n",
       " 460019572509980: 1,\n",
       " 460013534973214: 1,\n",
       " 460020174621985: 2,\n",
       " 460095192108326: 1,\n",
       " 466924250205478: 1,\n",
       " 460029893381417: 1,\n",
       " 460029143911725: 1,\n",
       " 460029866413371: 1,\n",
       " 460028207729980: 1,\n",
       " 460010312109373: 2,\n",
       " 460001681935678: 2,\n",
       " 460014888619327: 1,\n",
       " 460075943005505: 1,\n",
       " 460020846398787: 2,\n",
       " 460013010685253: 1,\n",
       " 460000650988876: 1,\n",
       " 460069007035736: 1,\n",
       " 460110448495961: 1,\n",
       " 460110725549401: 1,\n",
       " 460015450066264: 1,\n",
       " 460016986033499: 1,\n",
       " 460018778606947: 1,\n",
       " 460069127032165: 1,\n",
       " 460018698620272: 1,\n",
       " 460029866413429: 2,\n",
       " 460028138425719: 1,\n",
       " 460029995093368: 1,\n",
       " 460000970313092: 1,\n",
       " 460018638622095: 1,\n",
       " 460010812509584: 1,\n",
       " 460002851327385: 1,\n",
       " 460008532938140: 1,\n",
       " 460110417726892: 1,\n",
       " 460016032222637: 1,\n",
       " 460011133504941: 1,\n",
       " 460110413794745: 1,\n",
       " 460015472020923: 2,\n",
       " 460011518627266: 1,\n",
       " 460007890390473: 1,\n",
       " 460007686409674: 1,\n",
       " 460018948115919: 1,\n",
       " 460015856618963: 1,\n",
       " 460018708516313: 1,\n",
       " 460029141028314: 1,\n",
       " 460079750712795: 1,\n",
       " 460000581389804: 2,\n",
       " 460014956613102: 1,\n",
       " 460001102597615: 1,\n",
       " 460001941982712: 1,\n",
       " 460002261634553: 1,\n",
       " 460069007035900: 1,\n",
       " 460016106114567: 1,\n",
       " 460001711918599: 1,\n",
       " 460045960908296: 1,\n",
       " 460110388497932: 1,\n",
       " 460110445940238: 1,\n",
       " 460078641516049: 1,\n",
       " 460001411567122: 1,\n",
       " 460010855501331: 1,\n",
       " 460018541268500: 1,\n",
       " 460069007035935: 1,\n",
       " 460002606812717: 1,\n",
       " 460016126103087: 1,\n",
       " 460016667627061: 2,\n",
       " 460000282611260: 1,\n",
       " 460002215104061: 2,\n",
       " 460000940330562: 1,\n",
       " 460077079793221: 1,\n",
       " 460015886208581: 1,\n",
       " 460015557611087: 1,\n",
       " 460009771961941: 2,\n",
       " 460006815010394: 1,\n",
       " 460009781988957: 1,\n",
       " 460028896218719: 2,\n",
       " 460003762212453: 1,\n",
       " 460002851327591: 1,\n",
       " ...}"
      ]
     },
     "execution_count": 324,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
